0
点赞
收藏
分享

微信扫一扫

子查询返回的值多于一个


操作数据库编写了一个存储过程:
大体如下:

select A,B from Table1 where C = (select X from Table2 where T=XX)



运行调用此存储过程时,报如下错误:
子查询返回的值多于一个。当子查询跟随在=、!=、<、<=、>、>=之后,或子查询用作表达式时,这种情况是不允许的。
解放办法:
修改存储过程如下:

select A,B from Table1 where C 
in (select X from Table2 where T=XX)


貌似是语法逻辑问题。

举报

相关推荐

0 条评论