Skip to content
Advertisement

SQL Can I use CASE statement with addition condition in a JOIN condition

I want to use join with case statement and addition condition, for example :

But this code results in a syntax error. Can anyone help to explain a little?

Advertisement

Answer

Using Case When then in Join Condition and in Where Clause is not possible in this case What you are trying to achieve is doable with And and OR like below.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement