摘要: DELETE u.*,acu.*,alu.* FROM user u, accountuser acu ,algouser alu WHERE u.userId=11 and acu.userID=11 and alu.userId=11 阅读全文
posted @ 2017-01-04 15:03 苍洱 阅读(370) 评论(0) 推荐(0) 编辑
摘要: create view user_account_view asSELECT u.userId UserId ,u.userCode UserCode,GROUP_CONCAT(ac.id) AccountIdList,GROUP_CONCAT(ac.accountCode) AccountCode 阅读全文
posted @ 2017-01-04 14:59 苍洱 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 将 countertype 整数类型转成字符串类型 SELECT counterType, CASE counterType WHEN 1 THEN 'CTP'WHEN 2 THEN 'NULL'WHEN 3 THEN '飞鼠'WHEN 4 THEN '飞鼠 FIX'WHEN 5 THEN 'CTP 阅读全文
posted @ 2017-01-04 14:50 苍洱 阅读(5642) 评论(0) 推荐(0) 编辑
摘要: insert into urls(company,counterType,mdUrl,tradeUrl) values('test', CASE 'test'WHEN 'CTP' THEN 1WHEN 'NULL' THEN 2WHEN '飞鼠' THEN 3WHEN '飞鼠 FIX' THEN 4 阅读全文
posted @ 2017-01-04 14:48 苍洱 阅读(1498) 评论(0) 推荐(0) 编辑
摘要: 数据库表中id列不为自动增加,需要程序来增加id的SQL SELECTCASE IFNULL(MAX(id),1)WHEN 1 THEN 1ELSE MAX(id) + 1END AS newmaxidFROM test 阅读全文
posted @ 2017-01-04 14:35 苍洱 阅读(4436) 评论(0) 推荐(0) 编辑