1
Table 1
Empaname empid Deptid
kumar 23 1
kumar 23 2
manu 45 3
manju 34 4
manju 34 5
manju 34 6
Table2
Empaname empid Deptid
kumar 23 1
manu 45 3
manju 34 5
在这里,我有2代表我正在比较基于两个表中的值,我需要更新值INT表2SQL查询问题
if exists(select Empid from [email protected] and [email protected] and DEptid<>@intdepID)
Begin
//here both Empname and Empid is matching and DeptID is not matching then do not do anything just return an value as 2
return 2
end
else
begin
//Update the record vales to an Temp Table
end
我写这个查询,它是越来越失败该条件。
任何一个可以帮助我写一个查询此
感谢
“这是越来越失败” - 用一个错误或者它不会做你希望它做什么?你能添加你的确切查询,包括更新语句吗?如果它产生一个错误,你能否也请张贴它? – rkellerm 2010-12-06 13:16:34