以下是我的查詢顯示分區,但我需要選擇所有數據的分區= nagpur哪裏把條件放入JOIN查詢?
我的意思是,我想把條件放在我的查詢中。請建議我如何在下面的查詢中實現條件。
SELECT RES.PARTYNAME, RES.DISTRICT, COUNT(RES.CONSTITUENCY) AS VOTESCOUNT
FROM voter_count RES
JOIN
(SELECT CONSTITUENCY, MAX(VOTES) AS VOTES
FROM voter_count
GROUP BY CONSTITUENCY) MAXS
USING (VOTES, CONSTITUENCY)
GROUP BY PARTYNAME,DISTRICT
後'from' :-)或''組by'後having'。 – Rufinus 2014-10-11 12:49:35