0

This seems like it should be a simple query but I think I have my eyes in backwards...

Give me all the users living in Jefferson, Bingham, Butte, Bonneville and Madison counties in the state of Idaho.

SELECT * FROM table WHERE county='Jefferson' OR county='Bingham' OR county='Butte' OR county='Bonneville' OR county='Madison' AND state='ID'

What I get is all users living in EVERY Jefferson county in the U.S!!!! My state='ID' gets ignored and none of the other counties are searched (not even in the other states!).

I'm confused... LOL

(and I know this is gonna be one of those forehead slap moments!)

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by ppetree
0
SELECT * FROM table WHERE (county='Jefferson' OR county='Bingham' OR county='Butte' OR county='Bonneville' OR county='Madison') AND state='ID'
0

<headslap>doh!</headslap>

Damn! I shoulda thought of that! Thanks!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.