Wygeneruj n wierszy NULL w PostgreSQL
Mam tabelę, która wygląda tak:
id, integer, Primary Key, not null
name, character varying
created, timestamp without timezone, not null, default: now()
Chcę wygenerować n wierszy z NULL w polu nazwy.
Wiem, że mogę to zrobić:
INSERT INTO
employee (name)
VALUES
(NULL),
(NULL)...
Ale wolałbym zrobić coś takiego:
INSERT INTO
employee (name)
SELECT
NULL
FROM
dummy_table_with_n_rows
I będę mógł wybrać n.