0
是否有一種方法僅在單個列的select case語句中進行排序?讓我們只能說在城市上升的順序。在select - case語句中排序
SELECT
StudentLocation =
CASE
WHEN @IsRegistered IS NOT NULL AND @IsInClass IS NOT NULL THEN s.InClassLocation
WHEN @IsRegistered IS NOT NULL AND @IsInClass IS NULL THEN s.OnlineLocation
ELSE s.City + ', ' + s.State
END
你有也是FROM,WHERE? – EvgenyKolyakov
可能我不明白目的。但是,爲什麼你不去做這樣的SELECT * FROM(SELECT StudentLocation = CASE WHEN IsRegistered IS NOT NULL,當IsRegistered IS NOT NULL和IsInClass爲null,則s.OnlineLocation ELSE小號IsInClass IS NOT NULL THEN s.InClassLocation 。 City +','+ s.State END)order by – Dasma