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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query - select multiple rows

Status
Not open for further replies.

tonymm

Technical User
Aug 6, 2001
8
AU
I have a table called Contacts that has a column called "id". I want to extract from that table all row data where id = specific values

i have tried the following but it doesnt work

SELECT * FROM abc.tablename WHERE id='1' AND id='2' AND id='3'

I'm obviously not an SQL person but I need to be able to extract multpile row data..

any help appreciated

tony

 
Or:
SELECT * FROM abc.tablename WHERE id IN ('1', '2', '3')

Dieter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top