To talk on Icrontic, just register!

It only takes 30 seconds.

Have an account? Sign in:

Forgot?
shwaip
elaborate bot
shwaip
5,730 Posts

SQL query question

My CS220 project is to build a java program that interacts with a database somehow. Our project basically queries a pre-built database. I got stuck with the code-bitch role (the rest of my group aren't too good at it).

I've gotten most of the queries that I want to work, but I cannot make a filename search that does not match exactly. It takes a string from the user, and creates a query using that. I've tried the using the asterisk as a wildcard, but it does not seem to work. The book that was reccomended for the class did not address this topic, or I just cannot find it. Help meh pls!
__________________ my photostream for ic photography challenge

Anyone who wants dropbox, please use my referral link
a2jfreak
madasiemanym
a2jfreak
3,351 Posts
You are using LIKE, right?

SELECT * WHERE field LIKE "%blah"
Or whatever suits your needs.
__________________
One thing kids like is to be tricked. For instance, I was going to take my little nephew to Disneyland, but instead I drove him to an old burned-out warehouse. "Oh, no," I said. "Disneyland burned down." He cried and cried, but I think that deep down, he thought it was a pretty good joke. I started to drive over to the real Disneyland, but it was getting pretty late.
Jack Handey
[folding_sig1]Child Search Ministries.
A Christian Charity for Missing Children.

Get Firefox!
shwaip
elaborate bot
shwaip
5,730 Posts
Like (heh) I said the book sucked, so there was no mention of "LIKE". Thanks, I'll try that now

//
Thanks, it works fine.

This is definitely the worst taught class I've ever been in. The teacher told us what we had to do, but not how (I understand that happens in the real world, but hey, he's actually supposed to teach us stuff ), and that everything we needed to know would be in that book. But...meh, what can you do
a2jfreak
madasiemanym
a2jfreak
3,351 Posts
Welcome
Enverex
~-+-~
Enverex
5,852 Posts
You'll want to use

Select BLAH from BLAH where BLAH = BLAH

too, if you want to pick something out specifically. The %'s are wildcards like * normally. I.e. "Like %Blah" will find eggyblah and blah but not blahstable, opposite with blah%, it will find blashstabe and blah, but not happyblah.

NS
__________________ RetroTracks - Classic Computer and Game Music
shwaip
elaborate bot
shwaip
5,730 Posts
Thx NS, but that was in the book .
Go Back   Icrontic Forums > Tech: Software > Web & Digital Media
Jump to
This Thread Search this Thread
Search this Thread:

Advanced Search


Current time: 1:27pm (GMT)
Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Get Vanilla instead. Trust me.