Reputation: 39
I am having difficulties combining the two statements below. I need my query to look for statement 1 OR statement 2. I can't figure out how to add an OR statement between the two. #Standard-SQL
Statement 1
WHERE
(feedback IS NOT NULL OR text IS NOT NULL)
AND rating <= 2
Statement 2
WHERE
(rating = 3 OR rating = 4)
AND feedback IS NOT NULL
Ideal Result is something like this...
WHERE
(feedback IS NOT NULL OR text IS NOT NULL)
AND rating <= 2
OR
(rating = 3 OR rating = 4)
AND feedback IS NOT NULL
Upvotes: 0
Views: 4634
Reputation: 50034
Encapsulate both FULL conditions in parentheses:
WHERE
(
(feedback IS NOT NULL OR text IS NOT NULL)
AND rating <= 2
)
OR
(
(rating = 3 OR rating = 4)
AND feedback IS NOT NULL
)
Upvotes: 2