Given the following table:
id column1 column2 ------------------------- 1 3 8 2 4 7 3 4 10 4 4 14 5 14 17 6 10 27 7 14 21 8 16 14 9 21 4 10 30 3
What is the best way to query for row selection when numbers 4 and 14 are selected in column1
or column2
, but exclude when numbers 4 and number 14 are in a string. Please note that the order may be canceled.
expected output
id column1 column2 ------------------------- 2 4 7 3 4 10 5 14 17 7 14 21 8 16 14 9 21 4
source share