gpt4 book ai didi

PostgreSQL:多次指定列 "crab_id"

转载 作者:行者123 更新时间:2023-11-29 14:19:41 25 4
gpt4 key购买 nike

使用 PostgreSQL 调用,

CREATE TABLE condor_xrootd AS
SELECT * FROM condor INNER JOIN xrootd_ext
ON (
xrootd_ext.CRAB_Id = condor.CRAB_Id AND
REPLACE(condor.CRAB_ReqName, '_', ':') = xrootd_ext.CRAB_ReqName
);

我得到了错误,

$ psql condor -f ./sql/inner_join.sql 
psql:./sql/inner_join.sql:6: ERROR: column "crab_id" specified more than once

这是可以理解的,因为每个表都有一个 Crab_Id 列。我希望能够在不指定列的情况下进行内部联接,因为我在两个表中总共有大约 400 列。

请告诉我是否可以在不单独列出列的情况下以某种方式消除此错误。

编辑:

我忘了提及速度和稳定性在这里至关重要,因为我的加入可能需要几天时间。

最佳答案

create table condor_xrootd as
select *
from
condor
inner join
xrootd_ext using (crab_id)
where replace(condor.crab_reqname, '_', ':') = xrootd_ext.crab_reqname

关于PostgreSQL:多次指定列 "crab_id",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33676884/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com