1 2 3 4 5 6 7 8 9
|
SELECT (case when Valeur='MATIERE' then Valeur else 'MATIERE' end) as [Valeur1], (case when Id_Style=4 then Id_Style else 4 end) as [Style1], (case when Id_Cellule=30 then Id_Cellule else 30 end) as [Id_Cellule1], (case when Valeur='CADRE' then Valeur else 'CADRE' end) as [Valeur2], (case when Id_Style=4 then Id_Style else 4 end) as [Style2], (case when Id_Cellule=31 then Id_Cellule else 31 end) as [Id_Cellule2], (case when Valeur='CADRE' then Valeur else 'CADRE' end) as [Valeur3], (case when Id_Style=4 then Id_Style else 4 end) as [Style3], (case when Id_Cellule=32 then Id_Cellule else 32 end) as [Id_Cellule3], (case when Valeur='' then Valeur else '' end) as [Valeur4], (case when Id_Style=0 then Id_Style else 0 end) as [Style4], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule4], (case when Valeur='' then Valeur else '' end) as [Valeur5], (case when Id_Style=0 then Id_Style else 0 end) as [Style5], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule5], (case when Valeur='' then Valeur else '' end) as [Valeur6], (case when Id_Style=0 then Id_Style else 0 end) as [Style6], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule6], (case when Valeur='' then Valeur else '' end) as [Valeur7], (case when Id_Style=0 then Id_Style else 0 end) as [Style7], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule7], (case when Valeur='' then Valeur else '' end) as [Valeur8], (case when Id_Style=0 then Id_Style else 0 end) as [Style8], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule8], (case when Valeur='' then Valeur else '' end) as [Valeur9], (case when Id_Style=0 then Id_Style else 0 end) as [Style9], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule9], Id_Tableau FROM Ligne, Cellule WHERE Ligne.Id_Ligne=Cellule.Id_Ligne AND Id_Tableau=4 AND Ligne.Id_Ligne=9
UNION
SELECT (case when Valeur='MATIERE' then Valeur else 'MATIERE' end) as [Valeur1], (case when Id_Style=4 then Id_Style else 4 end) as [Style1], (case when Id_Cellule=33 then Id_Cellule else 33 end) as [Id_Cellule1], (case when Valeur='17-23 mm' then Valeur else '17-23 mm' end) as [Valeur2], (case when Id_Style=3 then Id_Style else 3 end) as [Style2], (case when Id_Cellule=34 then Id_Cellule else 34 end) as [Id_Cellule2], (case when Valeur='13 mm' then Valeur else '13 mm' end) as [Valeur3], (case when Id_Style=3 then Id_Style else 3 end) as [Style3], (case when Id_Cellule=35 then Id_Cellule else 35 end) as [Id_Cellule3], (case when Valeur='' then Valeur else '' end) as [Valeur4], (case when Id_Style=0 then Id_Style else 0 end) as [Style4], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule4], (case when Valeur='' then Valeur else '' end) as [Valeur5], (case when Id_Style=0 then Id_Style else 0 end) as [Style5], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule5], (case when Valeur='' then Valeur else '' end) as [Valeur6], (case when Id_Style=0 then Id_Style else 0 end) as [Style6], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule6], (case when Valeur='' then Valeur else '' end) as [Valeur7], (case when Id_Style=0 then Id_Style else 0 end) as [Style7], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule7], (case when Valeur='' then Valeur else '' end) as [Valeur8], (case when Id_Style=0 then Id_Style else 0 end) as [Style8], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule8], (case when Valeur='' then Valeur else '' end) as [Valeur9], (case when Id_Style=0 then Id_Style else 0 end) as [Style9], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule9], Id_Tableau FROM Ligne, Cellule WHERE Ligne.Id_Ligne=Cellule.Id_Ligne AND Id_Tableau=4 AND Ligne.Id_Ligne=10
UNION
SELECT (case when Valeur='Alu incolore' then Valeur else 'Alu incolore' end) as [Valeur1], (case when Id_Style=5 then Id_Style else 5 end) as [Style1], (case when Id_Cellule=36 then Id_Cellule else 36 end) as [Id_Cellule1], (case when Valeur='6105' then Valeur else '6105' end) as [Valeur2], (case when Id_Style=0 then Id_Style else 0 end) as [Style2], (case when Id_Cellule=37 then Id_Cellule else 37 end) as [Id_Cellule2], (case when Valeur='6107' then Valeur else '6107' end) as [Valeur3], (case when Id_Style=0 then Id_Style else 0 end) as [Style3], (case when Id_Cellule=38 then Id_Cellule else 38 end) as [Id_Cellule3], (case when Valeur='' then Valeur else '' end) as [Valeur4], (case when Id_Style=0 then Id_Style else 0 end) as [Style4], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule4], (case when Valeur='' then Valeur else '' end) as [Valeur5], (case when Id_Style=0 then Id_Style else 0 end) as [Style5], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule5], (case when Valeur='' then Valeur else '' end) as [Valeur6], (case when Id_Style=0 then Id_Style else 0 end) as [Style6], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule6], (case when Valeur='' then Valeur else '' end) as [Valeur7], (case when Id_Style=0 then Id_Style else 0 end) as [Style7], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule7], (case when Valeur='' then Valeur else '' end) as [Valeur8], (case when Id_Style=0 then Id_Style else 0 end) as [Style8], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule8], (case when Valeur='' then Valeur else '' end) as [Valeur9], (case when Id_Style=0 then Id_Style else 0 end) as [Style9], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule9], Id_Tableau FROM Ligne, Cellule WHERE Ligne.Id_Ligne=Cellule.Id_Ligne AND Id_Tableau=4 AND Ligne.Id_Ligne=11
UNION
SELECT (case when Valeur='Laiton' then Valeur else 'Laiton' end) as [Valeur1], (case when Id_Style=5 then Id_Style else 5 end) as [Style1], (case when Id_Cellule=39 then Id_Cellule else 39 end) as [Id_Cellule1], (case when Valeur='6106' then Valeur else '6106' end) as [Valeur2], (case when Id_Style=0 then Id_Style else 0 end) as [Style2], (case when Id_Cellule=40 then Id_Cellule else 40 end) as [Id_Cellule2], (case when Valeur=' ' then Valeur else ' ' end) as [Valeur3], (case when Id_Style=0 then Id_Style else 0 end) as [Style3], (case when Id_Cellule=41 then Id_Cellule else 41 end) as [Id_Cellule3], (case when Valeur='' then Valeur else '' end) as [Valeur4], (case when Id_Style=0 then Id_Style else 0 end) as [Style4], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule4], (case when Valeur='' then Valeur else '' end) as [Valeur5], (case when Id_Style=0 then Id_Style else 0 end) as [Style5], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule5], (case when Valeur='' then Valeur else '' end) as [Valeur6], (case when Id_Style=0 then Id_Style else 0 end) as [Style6], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule6], (case when Valeur='' then Valeur else '' end) as [Valeur7], (case when Id_Style=0 then Id_Style else 0 end) as [Style7], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule7], (case when Valeur='' then Valeur else '' end) as [Valeur8], (case when Id_Style=0 then Id_Style else 0 end) as [Style8], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule8], (case when Valeur='' then Valeur else '' end) as [Valeur9], (case when Id_Style=0 then Id_Style else 0 end) as [Style9], (case when Id_Cellule=0 then Id_Cellule else 0 end) as [Id_Cellule9], Id_Tableau FROM Ligne, Cellule WHERE Ligne.Id_Ligne=Cellule.Id_Ligne AND Id_Tableau=4 AND Ligne.Id_Ligne=12
ORDER BY Id_Tableau |
Partager