The goal is to create a temp table with consecutive numbers from 1 to 25567.
I tried this SQL statements:
-- Create temp table
DROP TABLE IF EXISTS numbers;
CREATE TEMP TABLE numbers
(
n INT NOT NULL PRIMARY KEY
);
-- Insert numbers from 1 to 25567
INSERT INTO numbers
SELECT ROW_NUMBER() OVER () AS n
FROM stl_scan
LIMIT 25567;
SELECT COUNT(*) FROM numbers
3632
Why are there less rows than expected? and instead of starting at 1, the first row is 4, and goes on by 4 (8, 12, 16, and so on). I tried adding ORDER BY but the result is the same.