select 'Header1', 'Header2'...
union all
select * from TABLE where $conditions
into outfile 'c:/users/sf/desktop/output.csv'
fields terminated by ';'
lines terminated by '\n'
select * from (
select '0Header1', 'Header2'...
union all
select * from TABLE where $conditions ) foo
order by 1
into outfile 'c:/users/sf/desktop/output.csv'
fields terminated by ';'
lines terminated by '\n'
1条答案
按热度按时间plicqrtu1#
正如@rick\u james所建议的,select是无序的,因为不存在总体排序。可以这样解决:
前提是第一行的内容都按字母顺序排在“0header1”之后。