I'll try to explain the conundrum with an example. Suppose we have a table called table1, It has a single column id which has integer values. Say row values are 1,3,4,5
Now if I do select * from table1 where id = 2 I want to get all the rows since 2 does not exist in the table.
asked Mar 16, 2017 at 02:11 PM in Default
I'm a bit confused as to why this wouldn't work:
However, if that's definitely not the right answer, then perhaps thinking about what you're doing in terms of subqueries might be easier:
But this is beginning to give me a headache.
Have you tried
answered Mar 17, 2017 at 02:40 PM
If you want to list many values in the where clause, and still return data even when one of those does not match, you need an OR clause
This can also be written with an IN clause
answered Mar 21, 2017 at 08:16 AM
Kev Riley ♦♦