1、查询最大begindate的记录(一个clerkcode有多个begindate值的记录) ,相关子查询?in?:
select * from hi_psnjob a where a.begindate in ( select max(b.begindate) from hi_psnjob b where b.clerkcode = a.clerkcode)
本文介绍了一种使用 SQL 查询每个职员代码下最大开始日期记录的方法。通过子查询与 IN 运算符结合的方式,实现了从 hi_psnjob 表中筛选出每个 clerkcode 对应的最新 begindate 记录。
1、查询最大begindate的记录(一个clerkcode有多个begindate值的记录) ,相关子查询?in?:
select * from hi_psnjob a where a.begindate in ( select max(b.begindate) from hi_psnjob b where b.clerkcode = a.clerkcode)
3607

被折叠的 条评论
为什么被折叠?