单行子查询返回多个行

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
但不知是怎么导致的
展开
 我来答
野人无事不言L
2016-02-02 · TA获得超过1413万个赞
知道顶级答主
回答量:2242万
采纳率:0%
帮助的人:142.3亿
展开全部
select job,Min(sal),Max(sal) from emp Where job in ( Select job From emp Group By job Having Count(*)>=4) Group By job
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式