plsql可以执行但是在mybatis报子查询返回多行语句的错误

这是SQL:selectcreate_time,(selectcount(*)fromt_inspectionwhereinsp_status=4groupbycreat... 这是SQL:
select create_time,(select count(*) from t_inspection where insp_status = 4 group by create_time) as finishInsp from t_inspection where to_date(to_char(create_time,'yyyy-mm-dd'),'yyyy-mm-dd') <![CDATA[>=]]> (to_date(to_char(sysdate-30,'yyyy-mm-dd'),'yyyy-mm-dd')) and to_date(to_char(create_time,'yyyy-mm-dd'),'yyyy-mm-dd') <![CDATA[<=]]> (to_date(to_char(sysdate,'yyyy-mm-dd'),'yyyy-mm-dd'))
展开
 我来答
micro0369
2018-01-04 · TA获得超过1.2万个赞
知道大有可为答主
回答量:9250
采纳率:85%
帮助的人:4387万
展开全部
这个:
select count(*) from t_inspection where insp_status = 4 group by create_time
为什么要group by呢,确实有可能返回多行数据啊
可是你放到大的查询里,是不能出现多行的
去掉group by就行了
select count(*) from t_inspection where insp_status = 4
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

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

类别

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

说明

0/200

提交
取消

辅 助

模 式