How to add two columns for my query sentences? Thanks a lot!
I have a query sentence, this is the correct select results that I want. It returns 14 records.
select CNAME, DESCRIPTION
from CURRICULUM CU
where (CU.CID in (select CC.CID
from CURRICULUMCOURSE CC
inner join GROUPINGCOURSE GC on CC.COURSEID = GC.COURSEID
where GC.GROUPINGID in
(select GU.GROUPINGID
from GROUPINGUSERS GU
where LRAL_UID = '359')))
But for project requirement, I need to add two columns : CC.COURSEID, CU.CID
I wrote the following query sentence, but it returns 26 records.
select CNAME, DESCRIPTION, CC.COURSEID, CU.CID
from CURRICULUM CU INNER JOIN CURRICULUMCOURSE CC ON CU.CID = CC.CID
where (CU.CID in (select CC.CID
from CURRICULUMCOURSE CC
inner join GROUPINGCOURSE GC on CC.COURSEID = GC.COURSEID
where GC.GROUPINGID in
(select GU.GROUPINGID
from GROUPINGUSERS GU
where LRAL_UID = '359')))
The second query sentence should be wrong, espectially this part "INNER JOIN CURRICULUMCOURSE CC ON CU.CID = CC.CID" have some problem.
Could you please correct the second query, and make it get the same return results as the first one, as well add this two columns CC.COURSEID, CU.CID ?
Thanks a lot!