最新回答 / Lowell_hao
<...图片...>问题是怎么从右边转换为左边,我自己的答案是:select user_name,(select eq_name from `test_game` b where b.user_name = a.user_name and b.equipment = 'arms' ) as arms,(select eq_name from `test_game` c where c.user_nam...
2016-05-31
SELECT
SUM( CASE NAME WHEN '猪八戒' THEN num ELSE 0 END ) '猪八戒',
SUM( CASE NAME WHEN '沙僧' THEN num ELSE 0 END) '沙僧',
SUM( CASE NAME WHEN '孙悟空' THEN num ELSE 0 END) '孙悟空'
FROM test
SUM( CASE NAME WHEN '猪八戒' THEN num ELSE 0 END ) '猪八戒',
SUM( CASE NAME WHEN '沙僧' THEN num ELSE 0 END) '沙僧',
SUM( CASE NAME WHEN '孙悟空' THEN num ELSE 0 END) '孙悟空'
FROM test
2016-04-24