Need to run multiple joins where only matching rows will be returned. I would like to get values only from matching rows
I have such query:
select dc.STATUSWORK "DC STATUS", de.STATUSWORK "DE STATUS", r.STATUSWORK "R STATUS", g.STATUSWORK "G STATUS", c.STATUSWORK "CONTRACT Status", c.PYID from CONTRACT c join VDC dc on (dc.COVERKEY = c.KEY) join VDE de on (de.COVERKEY = c.KEY) join RCK r on (r.COVERKEY = c.KEY) join GDE g on (g.COVERKEY = c.KEY) join CDOC c on (c.COVERKEY = c.KEY) where c.PYID = 'C-1000';
For sure if not all the join conditions together are matching, no rows will be returned, if I use some left or right join, also rows with NULL values will be returned
How can I run the query to check before what are the matching rows and feed a new query to return only the matching tables/rows?