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'
转载于:https://www.cnblogs.com/kms1989/p/5600098.html
相关资源:MYSQL 常用语句