empid emplrcd effdt effsq
101 #1 2/1/99 0
101 #1 3/1/13 1
101 #1 23/3/13 1
101 #1 22/6/13 2
102 #2 20/6/91 1
我需要检索第 4 行,并且我已经编写了部分代码,请帮助我完成另一半。
select a*
from Ps_Job a
where a.empid = '101'
and a.emprcd ='#1'
and a.effdt = (select max(a1.effdt) from Psjob1) where...............
and a.effseq = (Select max(a2.effseq) from Ps_job2)
where..............
请帮我解决应该是通用的而不是特定于行的原因。我认为它应该充满 nth max 概念,但不确定。