子查询返回的值超过1.当子查询遵循=,!=,> =错误消息时,不允许这样做 [英] Subquery return more than 1 value. This is not permitted when the subquery follows =,!=,,>= error message

查看:76
本文介绍了子查询返回的值超过1.当子查询遵循=,!=,> =错误消息时,不允许这样做的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

exec [dbo]._uspSetColumnDefaultValue 'StkItem','Qty_on_Hand','float','0'
exec [dbo]._uspSetColumnDefaultValue 'StkItem','ReservedQty','float','0'
exec [dbo]._uspSetColumnDefaultValue 'StkItem','QtyOnPO,'float','0'

推荐答案

检查您的sp.
可能会有一个子查询返回一个以上的值.
当您在子查询上使用=,< =,> = !! =运算符时,该子查询必须返回单个值,否则请使用In或Not In子句.
Check your sp.
There might be one subquery which returns more then one value.
when you are using =,<=,>=,!= operator on subquery then that subquery must return single value or else use In or Not In clause.


检查子查询,它返回多个值,

请检查子查询的过滤条件,因为过滤后它应返回一个不为整数的值.
在子查询中使用 top 1或与众不同

祝您编码愉快!
:)
check sub-query it''s returning more than one value,

Check filtering conditions of sub-query because after filtration it should return one value not multiple.
Use top 1 or distinct in your sub-query

Happy Coding!
:)


检查子查询.您有很多选择.
1.使用 in 代替 = ,使用 not in 代替!= ,依此类推.
2.使用诸如sum/count/avg/max/min/first等分组
3.使用不重复或分组方式
4.在子查询中找到错误,并更正它以返回恰好一个值.

我要说的是,您宁愿选择选项4.当查询返回的一个以上的值恰好需要一个值时,则表示您的查询不正确,请避免使用选项1/2/3,除非恰恰是那样您需要.
Check the subquery. You have many options.
1. Use in instead of =, not in instead of != and so on.
2. Use grouping like sum/count/avg/max/min/first
3. Use distinct or group by
4. Find the error in the subquery and correct it to return exactly one value.

I would say you''d rather have to check option 4. When a query returns more than one value in place where you need exactly one, means your query is not correct, and avoid options 1/2/3 unless this is exactly that you need.


这篇关于子查询返回的值超过1.当子查询遵循=,!=,&gt; =错误消息时,不允许这样做的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆