Mysql常用语句(记一下,免得忘)
2013-06-19 17:54
375 查看
1、去掉某列记录中的特殊字符
例如:/r,update test_table set key=replace(key, char(13), '');
其他特殊字符类似。
2、查询重复的记录
Select weixinid From dianxin_highda_detail Group By weixinid Having Count(*)>1;
3、从txt向数据库导入记录
load data infile 'C:\\Program Files\\SecureCRT\\download\\6192.txt' into table dianxin_highda_detail;
load data infile 'C:\\Program Files\\SecureCRT\\download\\6192.txt' into table dianxin_highda_detail(accountname);
4、从数据库中导出数据到txt
select * from dianxin_highda_detail where sharetime>='2013-06-18 17:00:00' and sharetime<'2013-06-19 17:00:00' into outfile '/tmp/6192.txt';
例如:/r,update test_table set key=replace(key, char(13), '');
其他特殊字符类似。
2、查询重复的记录
Select weixinid From dianxin_highda_detail Group By weixinid Having Count(*)>1;
3、从txt向数据库导入记录
load data infile 'C:\\Program Files\\SecureCRT\\download\\6192.txt' into table dianxin_highda_detail;
load data infile 'C:\\Program Files\\SecureCRT\\download\\6192.txt' into table dianxin_highda_detail(accountname);
4、从数据库中导出数据到txt
select * from dianxin_highda_detail where sharetime>='2013-06-18 17:00:00' and sharetime<'2013-06-19 17:00:00' into outfile '/tmp/6192.txt';
相关文章推荐