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!

Combining logical operators 1

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
GB
I have been googling around to find the syntax used when combining logical operators in mysql but to no avail. I have found previews for books, had google tell me numerous times that there is no need to use 'AND' in searches (The search term I used was 'MYSQL combine AND and OR') and have followed numerous links to nowhere.
The good links I have found only deal with single operators or multiples of the same operator.
Can anyone suggest any good reading on the subject.
I have tried the obvious
Code:
SELECT * FROM TABLE WHERE (F1='A') AND (F2='B' OR F3='B' OR F4='C')
Thinking the brackets would group the parts together.
I need always to match f1='A' and any one or more of the others.

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top