I have the following tables and data
Table D
d_id
-----------
1
2
3
Table V
v_id d_id
----------- -----------
1 1
2 2
I am getting d_id which is not used in Table V and my query as follows
SELECT distinct(d.d_id) AS d
, v.v_id AS v
FROM
D LEFT JOIN V
ON ( d.d_id = v.v_id )
where v.v_id IS NULL
d_id
-------------
3
When i pass the value(eg : d.d_id = 2 ) to the query, i want a result in the following format
d_id
-------------
2
3