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