22,199
社区成员
发帖
与我相关
我的任务
分享
select * from TabB A
where not exists (select 1 from TabB where B=A.B and G>A.G)
SELECT *
FROM
(
SELECT *,
ROW_NUMBER() OVER (PARTITION BY B ORDER BY E DESC) rn
FROM B
) t
WHERE rn = 1;