Created
February 25, 2014 09:00
-
-
Save reyesyang/9205367 to your computer and use it in GitHub Desktop.
Export MySQL query result to CSV file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT id, username, (total_point - spent_point) AS point | |
FROM users | |
ORDER BY point DESC | |
LIMIT 50 | |
INTO OUTFILE '/tmp/bbs_points_top50.csv' | |
FIELDS TERMINATED BY ',' | |
ENCLOSED BY '"' | |
LINES TERMINATED BY '\n' | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment