subselect fails
project is a one-to-many releation to workunit on projectid.
workunit is a zero to many relation to billing on workunitid.
I want to get all workunits with any associated billings for a project id.
This works to get the workunitid.
select workunit.workunitid from project left join workunit on workunit.projectid = project.projectid where project.projectid = 9)
But when I include it as a subselect the billing,
select workunit.*, billing.* from workunit left join billing WHERE workunitid in (select workunit.workunitid from project left join workunit on workunit.projectid = project.projectid where project.projectid = 9)
fails withe message "... right syntax to use near 'where workunitid in (select workunit.workunitid from project left join workunit'
Among the things I tried is to qualify the where to read 'where workunit.workunitid in' and 'where billing.workunit in'
Subject
Written By
Posted
subselect fails
June 19, 2018 10:27AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.