【发布时间】:2013-05-15 20:00:25
【问题描述】:
我有一个如下所示的表格:
id, integer, Primary Key, not null
name, character varying
created, timestamp without timezone, not null, default: now()
我想生成 n 行,名称字段为 NULL。
我知道我能做到:
INSERT INTO
employee (name)
VALUES
(NULL),
(NULL)...
但我更喜欢这样做:
INSERT INTO
employee (name)
SELECT
NULL
FROM
dummy_table_with_n_rows
我可以选择n。
【问题讨论】:
标签: postgresql