22,206
社区成员
发帖
与我相关
我的任务
分享
SELECT *
FROM (SELECT *,
Row_number()OVER (partition BY filesname ORDER BY filesuploaddate DESC ) AS id
FROM table_a) a
WHERE id <= 1
select filesid,filesname,filesversion,path,filesUpLoadDate from tb as a
where not exists(select 1 from tb as x where x.filesname=a.filesname and x.filesUpLoadDate>=a.filesUpLoadDate)
SELECT *
FROM TB a
WHERE EXISTS ( SELECT 1
FROM ( SELECT filesname ,
MAX(filesversion) filesversion
FROM TB
GROUP BY filesname
) b
WHERE a.filesname = b.filesname
AND a.filesversion = b.filesversion )