最新回答 / Lowell_hao
<...圖片...>問題是怎么從右邊轉(zhuǎn)換為左邊,我自己的答案是: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...
已采納回答 / 詭異之心0908
給聚合函數(shù)count(*)取個別名就可以了, delete ……join (……count(*) as num? from ……)……
2016-05-09
這些技巧在做數(shù)據(jù)開發(fā)的時候很常用的,樓上不理解是因為沒遇到應(yīng)用場景
2016-05-04
并不少,做報表的經(jīng)常會用到,差不多也都是這樣,當(dāng)年還得各種找,老師不錯,技巧分享很必要
2016-05-04
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
老師講的很好,贊一個,但是工作中還是直接用php拆分字符串的方法去處理,不會加大sql負擔(dān)
2016-04-24