PHP, Postgresql, MySQL
Ich stecke in einer Abfrage fest. Ich weiß nicht, was genau das Problem ist. Kann mir jemand helfen?
Hier ist der Code:
während ich die Abfrage ausführe, wird der Fehler ausgegeben: FEHLER: Beziehung "CONTRACTORS" existiert nicht
select cont.name, cont.total,cp.contractor_id,cp.amount_paid,wt.id
FROM
(
select name,sum(amount_to_be_paid) as total
from "CONTRACTORS"
group by name
) cont
left join
(
select contractor_id,sum(amount_paid) as amount_paid
from "CONTRACTOR_PAYMENTS"
group by contractor_id
) cp
on cont.id= cp.contractor_id
left join worktypeids as wt on cont.worktypeid_id = wt.id AND wt.project_id=2