Hi @Spunny
I have a query same but only one of the where clauses differ. How do I make it into 1 sql query and have
Why you want a single query? Cause it is not only about merging two where conditions together, but also about writing the IF Else condition into it. In my opinion, this is an unnecessary action, and your current statement is logical enough.
Personally, it is recommended to seek optimization on the premise of clarifying the logic of the statement.
Best regards,
Cosmog Hong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".