mysql常用语句

1.select按条件设置默认值:

     SELECT IF(pay_name='N','未开户',"已开户") AS isopen,COUNT(user_id) FROM wb_user_account  GROUP BY isopen

 

2.sqlyog导入csv数据:

LOAD DATA LOCAL INFILE 'C:\\Users\\Administrator\\Desktop\\test.csv'
INTO TABLE cheyaoshi.daishou CHARACTER SET gbk
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"'
LINES TERMINATED BY '\r\n'

 

posted @ 2016-06-20 11:42  Mason.Ke  阅读(131)  评论(0编辑  收藏  举报