postgreSQL:在只有一列值更改的地方插入多行

postgreSQL:在只有一列值更改的地方插入多行,sql,postgresql,Sql,Postgresql,我有以下疑问: insert into TABLE1(a,b,c,d) VALUES('first','second','third',100); insert into TABLE1(a,b,c,d) VALUES('first','second','third',101); insert into TABLE1(a,b,c,d) VALUES('first','second','third',102); insert into TABLE1(a,b,c,d)

我有以下疑问:

    insert into TABLE1(a,b,c,d) VALUES('first','second','third',100);
    insert into TABLE1(a,b,c,d) VALUES('first','second','third',101);
    insert into TABLE1(a,b,c,d) VALUES('first','second','third',102);
    insert into TABLE1(a,b,c,d) VALUES('first','second','third',103);
column
a
b
c
在所有行中始终具有相同的值。我从另一个
表中的
select
语句中得到
100
101
102
103

    select id from TABLE2;        //returns (100,101,102,103).

我可以使用单个查询来执行此操作吗?

以下查询允许您根据另一个表上的查询结果插入多行

INSERT INTO TABLE1 (a, b, c, d) SELECT 'first', 'second', 'third', id FROM TABLE2;

以下查询允许您根据对另一个表的查询结果插入多行

INSERT INTO TABLE1 (a, b, c, d) SELECT 'first', 'second', 'third', id FROM TABLE2;

好的第一个SQL答案,肯。欢迎来到Stack@Twelfth谢谢!好的第一个SQL答案,肯。欢迎来到Stack@Twelfth谢谢!