I am not too much of a SQL person so it might be really easy for you guys..
I have 3 tables (site s,contracts c and detail d).
Not every site has a contract but when a contract exist for a site there also and always exists d.status.
I need to list every sites regardless of them having a contract or not and I need to list the contract id and its status.
I have put an outer join to fetch all sites and the contract id when it exist but when I introduce the detail table then I get error:
The table ‘contract' is an inner member of an outer-join clause. This is not allowed if the table also participates in a regular join clause.
My statement looks like this:
select s.site_id,c.id,d.status
from site s, contract c ,detail d
where c.x_contract2site=*s.objid
and c.status2gbst_elm=g.objid
Any hint would be much appreciated.
Thanks
I have 3 tables (site s,contracts c and detail d).
Not every site has a contract but when a contract exist for a site there also and always exists d.status.
I need to list every sites regardless of them having a contract or not and I need to list the contract id and its status.
I have put an outer join to fetch all sites and the contract id when it exist but when I introduce the detail table then I get error:
The table ‘contract' is an inner member of an outer-join clause. This is not allowed if the table also participates in a regular join clause.
My statement looks like this:
select s.site_id,c.id,d.status
from site s, contract c ,detail d
where c.x_contract2site=*s.objid
and c.status2gbst_elm=g.objid
Any hint would be much appreciated.
Thanks