pour déploiement auto v2 via gitlab
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

25 lines
1.4 KiB

src: |
SELECT 'M'::text ||
CASE
WHEN (p_calendrier_mois.mois - p_calendrier_mois_1.mois + 1::numeric) <= 12::numeric THEN p_calendrier_mois.mois - p_calendrier_mois_1.mois + 1::numeric
ELSE p_calendrier_mois.mois - p_calendrier_mois_1.mois + 1::numeric - 88::numeric
END::text AS code,
p_calendrier_mois.texte_court AS texte,
p_calendrier_mois.mois,
p_calendrier_mois_1.mois AS premier_mois
FROM base.p_calendrier_mois,
base.p_calendrier_mois p_calendrier_mois_1
WHERE p_calendrier_mois.mois >= p_calendrier_mois_1.mois AND (p_calendrier_mois.mois - p_calendrier_mois_1.mois) <= 99::numeric
UNION
SELECT 'N'::text ||
CASE
WHEN (p_calendrier_mois.mois - p_calendrier_mois_1.mois + 1::numeric) <= 12::numeric THEN p_calendrier_mois.mois - p_calendrier_mois_1.mois + 1::numeric
ELSE p_calendrier_mois.mois - p_calendrier_mois_1.mois + 1::numeric - 88::numeric
END::text AS code,
to_char(p_calendrier_mois.mois, 'FM999999'::text) AS texte,
p_calendrier_mois.mois,
p_calendrier_mois_1.mois AS premier_mois
FROM base.p_calendrier_mois,
base.p_calendrier_mois p_calendrier_mois_1
WHERE p_calendrier_mois.mois >= p_calendrier_mois_1.mois AND (p_calendrier_mois.mois - p_calendrier_mois_1.mois) <= 99::numeric
ORDER BY 4, 3;