How to select values in sql with null result
For example we have next table
user | code |
---|---|
user1 | code 1 |
user3 | code 2 |
user4 | code 4 |
Select
select * from table where user in ( 'user1', 'user2', 'user3', 'user4')
Result from select will be next
user | code |
---|---|
user1 | code 1 |
user2 | |
user3 | code 2 |
user4 | code 4 |
How to select values in sql with null result
2
Answers
You can do it by passing your condition as a subquery then apply
left join
with your table :Results :
Demo here
You can directly filter it in where clause