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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 select..where mutiples values same column

Author  Topic 

marco gwiliani
Starting Member

25 Posts

Posted - 2008-03-20 : 10:43:25
I need to do the below, however rather than typing A = everytime(I need to do it multiple times) can I somehow do A = 1,2,3 - how can I do this? thanks MArco

Select * from X
where A = 1 OR A = 2 OR A = 3 etc...

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-03-20 : 10:44:50
where A in (1,2,3)

Em
Go to Top of Page

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-03-20 : 10:45:37
or...

where A between 1 and 3

Em
Go to Top of Page

marco gwiliani
Starting Member

25 Posts

Posted - 2008-03-20 : 10:58:08
thanks, IN (A,B,C) did it.
Go to Top of Page
   

- Advertisement -