0

I'm struggling to get a SQL statement to run.

I need to have an and / or statement which gives me:

Where Condition 1 is true
OR
Where both Condition 2 AND Condition 3 are true. (not only one of them)   

Appreciate some ideas :)

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

-1

You can split them with parenthesis, you also only need to define 'WHERE' once. Example:

WHERE
    {condition_1} or ({condition_2} and {condition_3})

Edit: You don't technically require parenthesis due to AND having a higher precedence than OR, but it makes it much easier to read and see at a glance exactly what you're trying to do.

Michael
  • 153
  • 1
  • 9
  • Just seen. Also comments are not answers you can approve and have documented as working answers. – Michael Nov 19 '19 at 09:50