You must CROSS
join the table to the recursive cte to produce 1000 rows:
WITH RECURSIVE cte(x) AS (SELECT 1 UNION ALL SELECT x + 1 FROM cte WHERE x < 1000)
INSERT INTO MYTABLE (created, modified, anotherfield)
SELECT m.created, m.modified, m.anotherfield
FROM MYTABLE m CROSS JOIN cte c
WHERE m.id = 1;
See the demo (for 3 rows).
Another way to use the recursive cte:
WITH RECURSIVE cte AS (
SELECT created, modified, anotherfield, 1 x
FROM MYTABLE
WHERE id = 1
UNION ALL
SELECT created, modified, anotherfield, x + 1
FROM cte
WHERE x < 1000
)
INSERT INTO MYTABLE (created, modified, anotherfield)
SELECT created, modified, anotherfield
FROM cte;
See the demo.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…