1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| SELECT Article, PrixArticle, Attribut, ValeurEntier, ValeurTexte
FROM
(SELECT a.libelle AS Article, a.prix AS PrixArticle, att.nom AS Attribut, COALESCE(ValeurEntier.valeur, 0) AS ValeurEntier, '' AS ValeurTexte
FROM Article AS a, TypeArticle AS ta, Attribut AS att, ValeurAttribut AS va, ValeurAttributEntier AS ValeurEntier
WHERE a.id_TypeArticle = ta.id
AND att.id_TypeArticle = ta.id
AND att.id = va.id_Attribut
AND va.id_Article = a.id
AND va.id_TypeArticle = att.id_TypeArticle
AND va.id = ValeurEntier.id
AND ValeurEntier.id_Article = va.id_Article
AND ValeurEntier.id_TypeArticle = va.id_TypeArticle
AND ValeurEntier.id_TypeArticle = 1
UNION
SELECT a.libelle AS Article, a.prix AS PrixArticle, att.nom AS Attribut, 0 AS ValeurEntier, COALESCE(ValeurTexte.valeur, '') AS ValeurTexte
FROM Article AS a, TypeArticle AS ta, Attribut AS att, ValeurAttribut AS va, ValeurAttributTexte AS ValeurTexte
WHERE a.id_TypeArticle = ta.id
AND att.id_TypeArticle = ta.id
AND va.id_Attribut = att.id
AND va.id_Article = a.id
AND va.id_TypeArticle = att.id_TypeArticle
AND ValeurTexte.id = va.id
AND ValeurTexte.id_Article = va.id_Article
AND ValeurTexte.id_TypeArticle = va.id_TypeArticle
AND ValeurTexte.id_TypeArticle = 1
)AS tmp |
Partager