我想選擇具有最新日期的ROW。我似乎無法選擇ID和發佈。選擇有MAX日期的行
T.Released = MAX(T.Released)不適用於我。我正在使用MS SQL
SELECT ID , Released
FROM (SELECT [id]
,[Released]
FROM [dbo].[PressReleases]
where id in
(
.....
)) as T
Where T.Released = MAX (T.Released)
id Released
3 2016-05-26 19:30:41.100
214 2016-07-04 10:10:32.500
244 2017-01-20 12:20:29.900
247 2017-03-09 15:50:38.600
235 2017-06-01 18:10:38.900
237 NULL
這是MS SQL :) – SW2702