我正在尝试在Postgres中创建一个视图。我正在使用Dbeaver这样做。 我的查询如下:
s_id | s_cron | s_detail
sid000001 | 0 0/3 * * * ? | do job 1
抛出错误:
将VIEW customer_master创建为 SQL错误[42701]:错误:列“ submissionid”指定了多次。
有人遇到这样的问题吗?
答案 0 :(得分:0)
如果联接表之间有公共列,则需要使用适当的别名指定所有必需的列。
CREATE VIEW customer_master as
select info.submissionid as submissionid_1,
resp.submissionid as submissionid_2, --Keep one or use
--coalesce if one is null
--i.e coalesce(info.submissionid,resp.submissionid)
info.col2,
info.col3,
resp.col2,
resp.col3
--other columns with aliases
from survey_info info
full join survey_responses resp
on info.submissionid =resp.submissionid