filtering queries

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
garry27
Forum Commoner
Posts: 90
Joined: Sat Oct 14, 2006 1:50 pm

filtering queries

Post by garry27 »

is there an 'or' command in sql or an alternative i could use.i want to filter a select query by specific values, something like this:

SELECT pubID, pubName, pubPostcode FROM Pubs
WHERE pubID=3 OR pubID=4 OR pubID=6

TIA
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Yes there is, there is also IN too. You are using OR correctly in the example you posted.
Post Reply