SQL query question
shwaip
bluffin' with my muffin Icrontian
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!
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!
0
Comments
SELECT * WHERE field LIKE "%blah"
Or whatever suits your needs.
//
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
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