Consider I have a table like the following:
my_table
+---------------+
| id | name |
+---------------+
| 1 | ABC |
+---------------+
| 2 | XYZ |
+---------------+
| 3 | PQR |
+---------------+
| 4 | LMN |
+---------------+
And say I have a query like this
select * from my_table where id in (1,2,3,4,5)
Is it possible to get output like the following,by changing the query.
+---------------+
| id | name |
+---------------+
| 1 | ABC |
+---------------+
| 2 | XYZ |
+---------------+
| 3 | PQR |
+---------------+
| 4 | LMN |
+---------------+
| 5 | NULL |
+---------------+
I tried using self JOIN and other conditions and also google'd a lot,but didn't find a solution.
Can anyone suggest a solution?