هانیه_67
سه شنبه 29 اردیبهشت 1388, 20:43 عصر
سلام من تو sql اینquery رو نوشتم میاد کارمندای واحد 6 رو به شهر تهران انتقال میده و امتیازشون رو هم تغییر میده
CREATE PROCEDURE enteghal AS
update employee
set score=score+ (score/10) ,depnr = (select depnr
from department
where city='tehran') where depnr=6
GO
exec enteghal
اینو میده:
Server: Msg 512, Level 16, State 1, Procedure enteghal, Line 2
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.
چی کارش باید بکنم ؟:متفکر:
CREATE PROCEDURE enteghal AS
update employee
set score=score+ (score/10) ,depnr = (select depnr
from department
where city='tehran') where depnr=6
GO
exec enteghal
اینو میده:
Server: Msg 512, Level 16, State 1, Procedure enteghal, Line 2
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.
چی کارش باید بکنم ؟:متفکر: