Jump to content

How to test for strings usng an IN clause


jaymc

Recommended Posts

Take a look at the below code

[code]SELECT * FROM artists WHERE ID IN (1,4,7,21,51) LIMIT 0,5[/code]

I'm sure you know what thats doing..

Well, ive just spend an hour trying to get this working..

[code]SELECT * FROM artists WHERE username IN (ste,jeff,peter) LIMIT 0,3[/code]

I can only assume the IN() stuff works with numbers only?

If not, what am i doin wrong, if so... how can I replicate the function but querying for usernames rather than ID's

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.