Is there a more elegant way to write the following Microsoft SQL Server 2008 command?
UPDATE TableB SET TableBField2=0 WHERE TableBID IN( SELECT TableBID FROM TableB JOIN TableA on TableB.TableAID=TableA.TableAID WHERE TableBField2 < 0 AND TableAField1 = 0 )
In simple terms, I am updating a table based on the value of a field in a joined table. I wonder if my use of IN () is not considered inefficient.
sql-server-2005
Phillip senn
source share