📜  mysql 到带有标头的 outfile - SQL 代码示例

📅  最后修改于: 2022-03-11 15:04:54.332000             🧑  作者: Mango

代码示例1
SELECT * FROM (
    SELECT 'username','email'
    UNION ALL
    (
        SELECT `username`,`email`,`steam_id` FROM `users` WHERE `userna` LIKE '%@temp%'
    )
) resulting_set
INTO OUTFILE '/results/result.txt' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n';