|
Posted by Erland Sommarskog on 10/02/47 11:54
(harsha.21aug@gmail.com) writes:
> I'm a newbee to this forum. I've a question, is there any limitation
> on "IN" clause in select query.
> for example :
> "SELECT EMP_ID, EMP_NAME FROM EMPLOYEE WHERE EMP_ID IN
> ('EMP1001','EMP1002','EMP1003', etc, etc, so on)".
To add to Roy's response, be aware of that when the list grows very
long (> 1000 elements) compile times on SQL 2000 can be absymal. SQL 2005
appears to do better in this regard.
--
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
Navigation:
[Reply to this message]
|