Mysql常用語句(記一下,免得忘)

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';

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章