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.
Author |
Topic |
dionisio
Starting Member
2 Posts |
Posted - 2006-01-30 : 02:05:17
|
If someone can suggest me how to do a query like thatSELECT id,name from mytable WHERE ( id='1' OR id='2' OR id='9' );From what I can suppose it's not the best way to select multiple ids from the table, how can I do it in a smarter way?thank you |
|
shallu1_gupta
Constraint Violating Yak Guru
394 Posts |
Posted - 2006-01-30 : 02:14:36
|
Use In ClauseSELECT id,name from mytable WHERE id in (1,2,9,.. ); |
 |
|
dionisio
Starting Member
2 Posts |
Posted - 2006-01-30 : 02:38:46
|
tnx |
 |
|
|
|
|