单行子查询返回多个行
SELECTAUDITID,AUDITTYPE,(SELECTDOCNAMEFROMSYS_DOC_LISTWHEREDOCID=Q.DOCID)ASDOCNAME,(S...
SELECT AUDITID,
AUDITTYPE,
(SELECT DOCNAME FROM SYS_DOC_LIST WHERE DOCID = Q.DOCID) AS DOCNAME,
(SELECT PROJECTNAME
FROM PROJ_PROJECTINFO
WHERE PROJECTID = Q.PROJECTID) AS PROJECTNAME,
(SELECT PHASENAME
FROM PROJ_PHASE
WHERE PHASEID = Q.PHASE
AND DELFLAG = 0) AS PHASENAME,
ISCOMMIT,
ISCHECK,
REMARK,
DOCID,
ISNODOC,
CHECKSTATUS
FROM QA_PRODUCT_AUDIT Q
WHERE PROJECTID = 2945
order by PHASE desc
问题出在 (SELECT PHASENAME
FROM PROJ_PHASE
WHERE PHASEID = Q.PHASE
AND DELFLAG = 0) AS PHASENAME
但不知是怎么导致的 展开
AUDITTYPE,
(SELECT DOCNAME FROM SYS_DOC_LIST WHERE DOCID = Q.DOCID) AS DOCNAME,
(SELECT PROJECTNAME
FROM PROJ_PROJECTINFO
WHERE PROJECTID = Q.PROJECTID) AS PROJECTNAME,
(SELECT PHASENAME
FROM PROJ_PHASE
WHERE PHASEID = Q.PHASE
AND DELFLAG = 0) AS PHASENAME,
ISCOMMIT,
ISCHECK,
REMARK,
DOCID,
ISNODOC,
CHECKSTATUS
FROM QA_PRODUCT_AUDIT Q
WHERE PROJECTID = 2945
order by PHASE desc
问题出在 (SELECT PHASENAME
FROM PROJ_PHASE
WHERE PHASEID = Q.PHASE
AND DELFLAG = 0) AS PHASENAME
但不知是怎么导致的 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询