I am working on PostGreSQL Version 1.18.1, and i am facing an issue :
I want to insert many informations and want to make it work like a loop, but for my request i need two loops (one inside the other)
my request look like this :
INSERT INTO table_hour (annee , mois , id_operateur , nombre_heure_sup , nombre_jour_recup )
SELECT 2017 , 2 , x.id , 0 , 0
FROM generate_series(1,6) AS x(id);
INSERT INTO table_hour (annee , mois , id_operateur , nombre_heure_sup , nombre_jour_recup )
SELECT 2017 , 3 , x.id , 0 , 0
FROM generate_series(1,6) AS x(id);
...
First Loop : id_operateur From 1 to 6.
Second Loop : mois From 2 to 1000.
I want to knwo how to make it one inside the other (it's the value mois how will be the second loop)
select version()