您的位置:首页 > 数据库 > MySQL

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';
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Mysql 特殊字符