SELECT DISTINCT
R.REGROUPEMENT_REFERENCE AS "CLASSIFICATION", -- Nature
R.REGROUPEMENT_REFERENCE AS "CLE_CLASSIFICATION",
R.REGROUPEMENT_DESCRIPTION AS "DESCR_CLASSIFICATION",
CASE WHEN "Regroupement_N_1" IS NOT NULL THEN '1-' || "Regroupement_N_1" END AS "NIVEAU_1",
"Regroupement_N_1" AS "CLE_NIVEAU_1",
"Regroupement_descr_N_1" AS "DESCR_NIVEAU_1",
CASE WHEN "Regroupement_N_1" IS NOT NULL THEN '2-' || "Regroupement_N_2" END AS "NIVEAU_2",
"Regroupement_N_2" AS "CLE_NIVEAU_2",
"Regroupement_descr_N_2" AS "DESCR_NIVEAU_2",
CASE WHEN "Regroupement_N_1" IS NOT NULL THEN '3-' || "Regroupement_N_3" END AS "NIVEAU_3",
"Regroupement_N_3" AS "CLE_NIVEAU_3",
"Regroupement_descr_N_3" AS "DESCR_NIVEAU_3",
CASE WHEN "Regroupement_N_1" IS NOT NULL THEN '4-' || "Regroupement_N_4" END AS "NIVEAU_4",
"Regroupement_N_4" AS "CLE_NIVEAU_4",
"Regroupement_descr_N_4" AS "DESCR_NIVEAU_4",
CASE WHEN "Regroupement_N_1" IS NOT NULL THEN '5-' || "Regroupement_N_5" END AS "NIVEAU_5",
"Regroupement_N_5" AS "CLE_NIVEAU_5",
"Regroupement_descr_N_5" AS "DESCR_NIVEAU_5"