Skip to content
Advertisement

SQL select when one condition or another are met but not both

Given the following table:

what is the nicest way to query selecting rows when number 4 and 14 are selected in column1 or column2 BUT exclude when number 4 and number 14 are both in the row. Be aware that the order can be reversed.

expected output

Advertisement

Answer

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