SQL查询 相同部门 中 年龄最大的 员工信息(A元素相同,查询B元素最大的数据)

select *  from   test1 t

    where   not   exists(select   1   from   test1   where   BranchId=t.BranchId and  Age> t.Age) 

posted @ 2022-05-31 16:05  人菜话多帅瓜皮  阅读(500)  评论(0编辑  收藏  举报