在 postgreSQL 中连接三个外部表
Join three foreign tables in postgreSQL
我有三个外部表 (visits, parts, problemdescription
),它们有一个公共列,名称为:“startDateTime
”
我想加入他们,所以我使用了以下查询:
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";
但是我得到了 postgres 的这个错误:
ERROR: missing FROM-clause entry for table "s"
用v替换s,因为你没有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";
我有三个外部表 (visits, parts, problemdescription
),它们有一个公共列,名称为:“startDateTime
”
我想加入他们,所以我使用了以下查询:
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";
但是我得到了 postgres 的这个错误:
ERROR: missing FROM-clause entry for table "s"
用v替换s,因为你没有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";