分类: Mysql/postgreSQL
2011-06-08 17:30:13
最尾三行是定义输出格式
SELECT a.email,b.server_id
FROM user a ,stastics.ldp_user b
WHERE a.uid=b.user_id and b.game_id=1 order by b.server_id desc
into outfile '/tmp/outfile.dat'
fields terminated by ','
enclosed by '"'
lines terminated by '\n';
最终以mysql daemon启动用户的身份写出文件到 /tmp/outfile.dat,
outfile.date的文件格式是普通的ANSCII文件。
文件内容看起来如下:
"121237","183.3.241.115","1292252222","LI","","","2011-02-15 22:59:45","0","0","0","0","0","0","0","0","0","0","0","0","0","0",\N,"China","0","","","","1","1"
"121542","116.22.51.212","1292271132","LI","","","2011-02-15 22:59:45","0","0","0","0","0","0","0","0","0","0","0","0","0","0",\N,"China","0","","","","1","1"