I have two tables in my database like this:
Table-1 Table-2
id Name id Name
1 A 1 D-a
2 B 2 D-b
3 C 3 D-c
4 D
I want a query which gives me output such as
A B C D-a D-b D-c
i.e. check if there is entry of D in Table-1 if there is then select all entries of Table-2 and remove D from output