"Kalen Delaney" <replies@public_newsgroups.com> wrote in message
news:OjicVXquHHA.3368@TK2MSFTNGP02.phx.gbl...
> Hi Rene
>
> The query with IN allows for the subquery to return more than one row.
> The query with = will fail if the subquery returns more than one row.
>
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
www.InsideSQLServer.com >
http://sqlblog.com >
>
> "Rene" <a@b.com> wrote in message
> news:u$e2JPquHHA.1164@TK2MSFTNGP02.phx.gbl...
>> Below are two update queries. One of the queries uses the *IN* keyword to
>> figure out what to update and the other one does not:
>>
>> --------------------------------------------------
>>
>> UPDATE SomeTable SET SomeColumn = 'abc'
>> WHERE AnotherColumn = (SELECT XColumn FROM XTable)
>>
>>
>> UPDATE SomeTable SET SomeColumn = 'abc'
>> WHERE AnotherColumn IN (SELECT XColumn FROM XTable)
>>
>> --------------------------------------------------
>>
>>
>> According to me, the syntax of both queries are correct and both should
>> do identical work, could someone set me straight about this? If both
>> queries syntax are correct, is there a benefit for using the IN keyword?
>>
>> Thank you.
>>
>>
>
>