我使用此查詢錯誤執行SQL Server查詢
select dbresultsid, TestCase, BuildID, Analyzed,
Verdict,
(select count(Verdict) from results where BuildID = 'Beta1'
and Verdict = 'PASS') AS PASS,
(select count(Verdict) from results where BuildID = 'Beta1'
and Verdict = 'FAIL') AS FAIL,
(select count(Verdict) from results where BuildID = 'Beta1'
and Verdict = 'INCONC') AS INCONC,
(select count(Verdict) from results where BuildID = 'Beta1'
and Verdict = 'TIMEOUT') AS TIMEOUT
from results
where BuildID = 'Beta1'
group by TestCase,dbresultsid
order by Analyzed
它說
列「results.BuildID」是 選擇列表中無效,因爲它包含的是不是 收到錯誤在合計 函數或GROUP BY子句中。'
同樣的查詢在MYSQL運行正常。誰能幫忙?
感謝,
@ck什麼不是什麼:感謝你對我的美化SQL代碼 – JPro 2009-11-27 13:43:42