啥!!! 行转列就讲了一半,就开始列转行了?
那个学生成绩表怎么转,只转了个最简单的!! 难道还用笛卡尔积!!!!????????????
那个学生成绩表怎么转,只转了个最简单的!! 难道还用笛卡尔积!!!!????????????
2015-08-21
SELECT SUM(CASE WHEN user_name='孙悟空' THEN kills END) AS '孙悟空',SUM(CASE WHEN user_name='猪八戒' THEN kills END) AS '猪八戒',SUM(CASE WHEN user_name='沙僧' THEN kills END) AS '沙僧' FROM user1 a JOIN user_kills b ON a.id=b.user_id;
2015-08-10
绝非鸡肋,实际应用中,行转列的情况多数出现在公司的各种报表中,比如财务报表、制造报表等等,行转列的技巧是很实用的
2015-07-15