我有一个SQL
文件,其中包含一些查询,我想从此查询中创建一个CSV
文件。当前SQL
文件包含以下代码:
SELECT
ID AS 'Donor ID',
directorsComments AS 'Director Comments',
external_donor_id AS 'Donor Number',
CASE
WHEN is_approved = '1'
THEN 'Approved'
ELSE 'Not Approved'
END AS 'Approval Status',
donor_status AS 'Donor Status',
screening_status AS 'Screening Status',
Title AS 'Title',
firstName AS 'First Name',
lastName AS 'Last Name',
dateStarted AS 'Created At',
dateSubmitted AS 'Last Updated',
ipAddress AS 'IP',
答案 0 :(得分:3)
这可以在没有PHP的情况下直接使用SELECT ... INTO OUTFILE FIELDS TERMINATED BY','命令:http://dev.mysql.com/doc/refman/5.7/en/select-into.html