我嘗試運行SQL查詢(MSSQL 2005)類似如下:了與組SQL查詢錯誤由
select top 20 d_date, date1, date2
from reestr_calculated
where reestr_id=2
group by date2
order by date2 desc
,我得到以下錯誤:
Column 'reestr_calculated.d_date' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
有誰知道我該如何處理這個錯誤?
!感謝你們! – Konstantinos