SQL更新查询问题 [英] Sql Update query problem

查看:199
本文介绍了SQL更新查询问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我正在使用简单的更新查询.

 更新 tmOredr  set  RequiredVectorFormatTypeID = 
其中 IsEmbroideryOrder = 0  and  RequiredVectorFormatTypeID = 7 



但这给了我这个错误.

子查询返回了多个值.当子查询遵循=,!=,<   <   > ,> =或将子查询用作表达式时.
该语句已终止.



我不知道子查询在哪里?请帮忙.

谢谢

更新原因
抱歉,我正在尝试自我加入,所以我错误地发布了它.实际上,我已经使用where子句

解决方案

是否不使用where运算符?

 更新 tmOredr  set  RequiredVectorFormatTypeID = 
 位置  IsEmbroideryOrder = 0  and  RequiredVectorFormatTypeID = 7 


我认为这不是有效的语法:

  UPDATE 
    tmOredr
设置
    RequiredVectorFormatTypeID = 
位置
    IsEmbroideryOrder =  0 
     AND  RequiredVectorFormatTypeID =  7  


 更新 tmOredr  set  RequiredVectorFormatTypeID = > null 
位置 IsEmbroideryOrder = 0  and  RequiredVectorFormatTypeID = 7 


Hello,
I am using simple update query.

update tmOredr set RequiredVectorFormatTypeID = null
where  IsEmbroideryOrder =0 and RequiredVectorFormatTypeID=7



But it is giving me this error.

Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
The statement has been terminated.



I dont understand where is subquery? Please help.

Thanks

Reason for update
Sorry i was trying self join so i post it wrongly. Actually I have used where clause

解决方案

Should you not be using the where operator?

update tmOredr set RequiredVectorFormatTypeID = null
WHERE  IsEmbroideryOrder =0 and RequiredVectorFormatTypeID=7


I don''t think this is valid syntax:

UPDATE
    tmOredr
SET
    RequiredVectorFormatTypeID = null
WHERE
    IsEmbroideryOrder = 0
    AND RequiredVectorFormatTypeID = 7


update tmOredr set RequiredVectorFormatTypeID = null
Where IsEmbroideryOrder =0 and RequiredVectorFormatTypeID=7


这篇关于SQL更新查询问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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