Hello, everyone.
I am new to Oracle (I have mostly MS-SQL experience) and have an issue that has me stumped.
LEFT OUTER JOIN is supposed to grab everything from the LEFT table that matches the WHERE clause, regardless of whether or not there is any corresponding data in the RIGHT table. I have a query that when run strictly on the LEFT table will produce 26 records; but when I include the code for the JOIN, I get nothing. Could someone please look at these and tell me what I am doing incorrectly?
Here is the code that is just for the LEFT table:
Code:
SELECT a.edu_id, a.edu_title, a.edu_desc_tx, a.app_nm, a.edu_prereq
FROM tableA a
WHERE a.trn_app_id = 3
AND a.edu_status = 'Y'
ORDER BY a.edu_reorder_id
This will return 26 records.
If I make it with the LEFT OUTER JOIN, I get ZERO records:
Code:
SELECT a.edu_id, a.edu_title, a.edu_desc_tx, a.app_nm, a.edu_prereq,
b.class_id, b.class_start_date, b.class_end_date
FROM tableA a LEFT OUTER JOIN tableB b ON b.edu_id = a.edu_id
WHERE a.trn_app_id = 3
AND a.edu_status = 'Y'
AND b.class_status = 'Y'
AND b.class_start_date > sysdate
ORDER BY a.edu_reorder_id, b.class_start_date
Thank you,