Q:

Show all emails in a list mysql

I'm certain this is a really easy question. I'm new to mysql. 
I need to find all emails in a list that i have. 
The list is about 40 emails.
this@gmail.com
that@gmail.com
another@gmail.com
onemore@gmail.com

I've tried this:
    SELECT * FROM `sales_flat_order` WHERE customer_email = "'this@gmail.com',     'this@gmail.com'"

    SELECT * FROM `sales_flat_order` WHERE customer_email = "this@gmail.com, this@gmail.com"

    SELECT * FROM `sales_flat_order` WHERE customer_email in(this@gmail.com, this@gmail.com)

and various other queries. any help would be appreciated.

A:

You were close, you want something like this...
SELECT * FROM `sales_flat_order` WHERE customer_email IN('this@gmail.com', 'that@gmail.com', etc)

you could also do this...
SELECT * FROM `sales_flat_order` WHERE customer_email = 'this@gmail.com' OR customer_email = 'that@gmail.com'

if you only need unique values then you can do this...
SELECT DISTINCT(my_field) FROM `sales_flat_order` WHERE customer_email = 'this@gmail.com' OR customer_email = 'that@gmail.com'

as mentioned in my comment, DISCTINT() takes a single field as an argument you cannot put * as the argument.

