SELECT
SinifNo, OgrNo, Kalan, Ad, Soyad, MAX(VadeGunu)
FROM
(SELECT
o.SinifNo, a.OgrNo, o.Ad, o.Soyad, o.Sezon, o.SubeKod,
o.TCNo, o.AnneAd, o.AnneMobil, o.BabaAd, o.BabaMobil,
a.Tarih, a.Tutar, a.Odenen, a.Kalan,
DATEDIFF(DAY, a.Tarih, (getdate() + 1)) AS VadeGunu
FROM
TblTahPlan a
JOIN
TblOgrenci o ON a.OgrNo = o.OgrNo)
GROUP BY
SinifNo, OgrNo, Kalan, Ad, Soyad
這是我的SQL查詢。但我得到這個錯誤:GROUP BY語法錯誤
Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'group'.
我能做些什麼來解決這個問題?
由於其工作 –