Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Where clause format

Author  Topic 

atiqraza
Starting Member

11 Posts

Posted - 2007-02-02 : 11:34:54
I am writiing a Select query which looks like
SELECT * from Alltrans where
Title_Number = 51055 or
Title_number = 51056 or
Title_Number = 51058 or
Title_number = 51065

is there anyways i can write it in way like
SELECT * from Alltrans where Title_Number = ( 51055 or 51056)
This way i can reduce the number of lines in my query

X002548
Not Just a Number

15586 Posts

Posted - 2007-02-02 : 11:38:20
SELECT *
FROM Alltrans
WHERE Title_Number IN (51055,51056,51058,51065)

Do you know what Books Online is?


Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

atiqraza
Starting Member

11 Posts

Posted - 2007-02-02 : 11:39:41
Yes i do, i just have a hard time trying to get the information that i need from there.
Go to Top of Page
   

- Advertisement -