select workcode,lastname,ndrjg,ndrbm,ndrgw,ntzxc,ntzrq,
(select hrcode from uf_cpdeptcode a,formtable_main_33 b where ndrbm=oabumen) hrbmcode,
(select hrcode from uf_cpsubcode e,formtable_main_33 b where ndrjg=oafenbu) hrgscode
from hrmresource a,uf_cpdeptcode d,uf_cpsubcode e,formtable_main_33 b inner join
(select MAX(requestid) as requestid from formtable_main_33 group by nddygxm) c on c.requestid=b.requestid where a.id=b.nddygxm
错误报告:子查询返回的值不止一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的
(select hrcode from uf_cpdeptcode a,formtable_main_33 b where ndrbm=oabumen) hrbmcode,
(select hrcode from uf_cpsubcode e,formtable_main_33 b where ndrjg=oafenbu) hrgscode
from hrmresource a,uf_cpdeptcode d,uf_cpsubcode e,formtable_main_33 b inner join
(select MAX(requestid) as requestid from formtable_main_33 group by nddygxm) c on c.requestid=b.requestid where a.id=b.nddygxm
错误报告:子查询返回的值不止一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的
lastname,
ndrjg,
ndrbm,
ndrgw,
ntzxc,
ntzrq,
( SELECT TOP 1 hrcode
FROM uf_cpdeptcode a,
formtable_main_33 b
WHERE ndrbm = oabumen) hrbmcode,
( SELECT TOP 1 hrcode
FROM uf_cpsubcode e,
formtable_main_33 b
WHERE ndrjg = oafenbu) hrgscode
FROM hrmresource a,
uf_cpdeptcode d,
uf_cpsubcode e,
formtable_main_33 b
INNER JOIN ( SELECT MAX(requestid) AS requestid
FROM formtable_main_33
GROUP BY nddygxm) c
ON c.requestid = b.requestid
WHERE a.id = b.nddygxm;