Help with a MySQL SELECT WHERE Clause

Posted by Dr. DOT on Stack Overflow See other posts from Stack Overflow or by Dr. DOT
Published on 2011-01-12T18:36:41Z Indexed on 2011/01/12 18:53 UTC
Read the original article Hit count: 253

Filed under:
|

A column in my table contains email addresses.

I have a text string that contains the a few usernames of email addresses separated by commas. I can make text sting into an array if necessary to get my SELECT WHERE clause to work correctly.

Text string search argument is 'bob,sally,steve'

I want to produce a WHERE clause that only returns rows where the username portion of the email address in the table matches one of the usernames in my text string search argument.

Thus a row with [email protected] would not be returned but [email protected] would be.

Does anyone have a WHERE clause sample that produces this result?

Thanks.

© Stack Overflow or respective owner

Related posts about sql

Related posts about mysql