-
-
Save malkafly/658fe7de98d27b4983f8f7c21a276381 to your computer and use it in GitHub Desktop.
Export MySQL query result to CSV file
This file contains hidden or 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