SELECT EMPLID
, LST_ASGN_START_DT
FROM PS_JOB A
WHERE A.EFFDT = (
SELECT MAX(EFFDT)
FROM PS_JOB
WHERE A.EMPLID = EMPLID
AND A.EMPL_RCD = EMPL_RCD
AND EFFDT <= SYSDATE )
AND A.EFFSEQ = (
SELECT MAX(EFFSEQ)
FROM PS_JOB
WHERE A.EMPLID = EMPLID
AND A.EMPL_RCD = EMPL_RCD
AND A.EFFDT = EFFDT )
AND HR_STATUS='A'
当直接在数据库上运行它时,我没有收到任何错误,但是当我在应用程序设计器上编译并构建它时,出现了“指定的列名数量无效”的错误
我也尝试过这种方法,但是仍然遇到相同的错误。
SELECT A.EMPLID
, A.LST_ASGN_START_DT
FROM PS_JOB A
WHERE A.EFFDT = (
SELECT MAX(EFFDT)
FROM PS_JOB
WHERE A.EMPLID = EMPLID
AND A.EMPL_RCD = EMPL_RCD
AND EFFDT <= SYSDATE )
AND A.EFFSEQ = (
SELECT MAX(EFFSEQ)
FROM PS_JOB
WHERE A.EMPLID = EMPLID
AND A.EMPL_RCD = EMPL_RCD
AND A.EFFDT = EFFDT )
AND A.HR_STATUS='A'
这也没什么。
SELECT A.EMPLID
, A.LST_ASGN_START_DT
FROM PS_JOB A
WHERE A.EFFDT = (
SELECT MAX(EFFDT)
FROM PS_JOB B
WHERE A.EMPLID = B.EMPLID
AND A.EMPL_RCD = B.EMPL_RCD
AND B.EFFDT <= SYSDATE )
AND A.EFFSEQ = (
SELECT MAX(EFFSEQ)
FROM PS_JOB C
WHERE A.EMPLID = C.EMPLID
AND A.EMPL_RCD = C.EMPL_RCD
AND A.EFFDT = C.EFFDT )
AND A.HR_STATUS='A'