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
 Select Statement...

Author  Topic 

vb89
Starting Member

9 Posts

Posted - 2008-09-16 : 10:24:50
If i was trying to build a query which returned any individuals with the following id number's it would look like:

select *
from table_name
where id = 0000
or id = 0001

is this what it would look like, or is there a better way of righting this query so it would perform better...thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-16 : 10:29:36
another way:-
select *
from table_name
where id in (0000,0001)
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-09-16 : 10:42:42
select *
from table_name
where id >= 0000 AND id <= 0001



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

vb89
Starting Member

9 Posts

Posted - 2008-09-16 : 10:42:58
thank you
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2008-09-16 : 11:31:08
hold the phone

id = 0000?????



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
   

- Advertisement -