Posted by Erland Sommarskog on 04/12/06 13:33
John Smith (genericemailaccount@genericdomain.genericTLD) writes:
> Is it okay to use a literal value with the IN clause. E.g.
>
> SELECT somefield, anotherfield
> ....
> WHERE ...etc.
> AND 1234 IN (SELECT userid FROM tblUsers)
>
> I was told it wasn't valid, but I'm pretty sure it worked for me. Just
> seeking clarification.
That should be OK. A bit unusual maybe, but certainly valid.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|