Aaron
Aaron

Reputation: 3639

MYSQL Query with OR

I am currently using the following SQL Query:

("SELECT * FROM `form` WHERE '1' IN (show1) AND 'agree' NOT IN (test)")

However I can't seem to work out how to add a OR in it.. I need to filter out if it's says 'agree' OR 'disagree'

Any ideas?

Upvotes: 2

Views: 68

Answers (1)

Katsuke
Katsuke

Reputation: 575

Assuming that show1 and test are columns and that this is Mysql related, this should work:

"SELECT * 
FROM `form` 
WHERE show1 IN ('1') 
    AND test NOT IN ('agree', 'disagree')"

I prefer to have the columns to the left of the comparison :)

Upvotes: 5

Related Questions