I have a Left Outer Join that goes and counts the number of rows where the column TC_Status = 'Passed'
However if I pass it a "RELEASE_CYCLES.RCYC_ID" that the table doesn't have then it joins "Null" to my existing table.
the RCYC_ID is just a number ex.1053
So im saying RCYC_ID = TC_ASSIGN_RCYC or 1053 = 1053
However if TC_ASSIGN_RCYC does not have a 1053 it returns NULL
What I need it to return is this:
(columns)TC_ASSIGN_RCYC CNT
(row) 1053 0
*I don't need the () values
So basically if the first table is null then return a table that "looks" like what it should have looked like if it counted 0.
Code:
LEFT OUTER JOIN (SELECT TC_ASSIGN_RCYC, COUNT(*) AS CNT
FROM TESTCYCL
WHERE TC_STATUS = 'Passed'
GROUP BY TC_ASSIGN_RCYC) AS CYCLE_PASSED_COUNT
ON RELEASE_CYCLES.RCYC_ID = CYCLE_PASSED_COUNT.TC_ASSIGN_RCYC
However if I pass it a "RELEASE_CYCLES.RCYC_ID" that the table doesn't have then it joins "Null" to my existing table.
the RCYC_ID is just a number ex.1053
So im saying RCYC_ID = TC_ASSIGN_RCYC or 1053 = 1053
However if TC_ASSIGN_RCYC does not have a 1053 it returns NULL
What I need it to return is this:
(columns)TC_ASSIGN_RCYC CNT
(row) 1053 0
*I don't need the () values
So basically if the first table is null then return a table that "looks" like what it should have looked like if it counted 0.