Rather than export the entire table, that is, fname, lname, address, email, etc. how can I export JUST the email field to CSV or Excel?
+3
A:
You can query the database and export the result.
Example:
SELECT fname FROM users INTO OUTFILE '/tmp/result.csv'
directly from mysql command line
or
SELECT fname FROM users
and export the result of this query from your favorite mysql client
Bogdan Constantinescu
2010-06-22 14:14:39
awesome.. thanks... what if i wanted to get crazy and add id>10,000 to get the most recent members or something... how can i do that? i tried the logical semantic language but got an error
adam
2010-06-22 15:07:01
Just add WHERE condition. SELECT fname FROM users WHERE id > 10000 INTO OUTFILE '/tmp/result.csv'
Naktibalda
2010-06-22 15:11:53