我有以下查询:
SELECT first, last, title, email, org
FROM people WHERE email <> ""
INTO OUTFILE 'C:/testfile.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n'
哪个有效。我需要选择不同的电子邮件(我不希望同一电子邮件中有多个条目)。
它会像这样工作吗?:
SELECT first, last, title, distinct(email), org
FROM people WHERE email <> ""
INTO OUTFILE 'C:/testfile.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n'