Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need query to select using WHERE from a list 1

Status
Not open for further replies.

hapax

Programmer
Nov 10, 2006
105
US
I need to select using a WHERE clause that contains a list of specific items. What's the syntax?

I want to do this:

SELECT * from ASSET
WHERE AssetId
(is in the following list of IDs: 214, 727, 317 or 283)
 
Code:
SELECT * from ASSET
WHERE AssetId IN
(214, 727, 317, 283)
 
Excellent, thanks.

I researched using IN but didn't see an example of this type of case.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top