I have three foreign tables (visits, parts, problemdescription
) having a common column named: "startDateTime
"
I want to join them, so I used the following query:
select v."startDateTime", p.znumber, pd.remark FROM visits v
INNER JOIN parts p
on s."startDateTime"=p."startDateTime" INNER JOIN problemdescription pd
on s."startDateTime"=pd."startDateTime";
But I get this error for postgres:
ERROR: missing FROM-clause entry for table "s"
Replace s with v, because you haven't table "s".
select v."startDateTime", p.znumber, pd.remark FROM visits v
INNER JOIN parts p
on v."startDateTime"=p."startDateTime" INNER JOIN problemdescription pd
on v."startDateTime"=pd."startDateTime";