こんな感じで、SELECT分の後にINTO OUTFILEを追加してあげればOKです。
1 2 3 4 5 6 |
SELECT * FROM user WHERE status = 1 ORDER BY id ASC INTO OUTFILE '/tmp/status_user.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'; |
こんな感じで、SELECT分の後にINTO OUTFILEを追加してあげればOKです。
1 2 3 4 5 6 |
SELECT * FROM user WHERE status = 1 ORDER BY id ASC INTO OUTFILE '/tmp/status_user.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'; |