찾다

 >  Q&A  >  본문

node.js - mysql 使用UNION ALL问题

SELECT LEVEL,man,woman FROM(
SELECT LEVEL,COUNT(*) AS 'woman' FROM
(SELECT id,LEVEL,sex FROM player_attributes WHERE sex=1)t1 GROUP BY LEVEL
UNION ALL
SELECT LEVEL,COUNT(*) AS 'man' FROM
(SELECT id,LEVEL,sex FROM player_attributes WHERE sex=0)t2 GROUP BY LEVEL
)t5 GROUP BY LEVEL

运行后报错:Unknown column 'man' in 'field list'

大家讲道理大家讲道理2781일 전592

모든 응답(0)나는 대답할 것이다

답장 없음
  • 취소회신하다