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

Select records based on multiple values 1

Status
Not open for further replies.

paulcat

Programmer
Joined
Mar 8, 2000
Messages
24
Location
US
How can I build an efficient SQL string to select records from a table with a field called STATUS that is 2 characters wide and can contain the string "00" to "99", if I only want to select the records with a 88,89,90,91,96,97,98? I know I can do it with multiple OR's, but there must be a more efficient way. In Clipper, I used to say "FOR STATUS $ '88,89,90,91,96,97,98'".
 
Select STATUS from tablename where STATUS in ('88','89','90','91','96','97','98')

Rick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top