text to sql syntaxMon, 27 Feb 2023

create 24 consecutive inserts starting date 3-10-2023 and adding 1 hour. Use a table named PATATA with the first column ot type date, and the second of type number with a random value

INSERT INTO PATATA (fecha, dia) SELECT date '2023-03-10' + (INTERVAL '1 hour' * s.a) as fecha, RANDOM() as dia FROM generate_series (1,24) AS s(a) ORDER BY fecha;

Questions about programming?Chat with your personal AI assistant