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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
(
SELECT
`defauts`.`Champs0` AS `adresse_defaut`,
`defauts`.`Champs1` AS `symbole_element`,
`defauts`.`Champs3` AS `commentaire`,
`E_S`.`Champs6` AS `nom_machine`,
`defauts`.`Champs9` AS `type_element`,
nz(`moteur`.`Champs13`, nz(`trappe`.`Champs13`, `B2d`.`Champs13`)) AS `entree1`,
'' AS `entree2`,
nz(`moteur`.`Champs14`, nz(`trappe`.`Champs14`, `B2d`.`Champs14`)) AS `sortie1`,
'' AS `sortie2`
FROM
(
(
(
`defauts`
LEFT JOIN `E_S` ON `E_S`.`Champs2` = `defauts`.`Champs1`
)
LEFT JOIN `moteur` ON `moteur`.`Champs0` = `defauts`.`Champs1`
)
LEFT JOIN `trappe` ON `trappe`.`Champs0` = `defauts`.`Champs1`
)
LEFT JOIN `B2d` ON `B2d`.`Champs0` = `defauts`.`Champs1`
WHERE
`defauts`.`Champs0` <> ''
AND `defauts`.`Champs1` <> ''
)
UNION ALL
(
SELECT
`Defautsp`.`Champs0` AS `adresse_defaut`,
`Defautsp`.`Champs1` AS `symbole_element`,
`Defautsp`.`Champs3` AS `commentaire`,
`E_S`.`Champs6` AS `nom_machine`,
`Defautsp`.`Champs9` AS `type_element`,
nz(`moteur`.`Champs13`, nz(`trappe`.`Champs13`, `B2d`.`Champs13`)) AS `entree1`,
'' AS `entree2`,
nz(`moteur`.`Champs14`, nz(`trappe`.`Champs14`, `B2d`.`Champs14`)) AS `sortie1`,
'' AS `sortie2`
FROM
(
(
(
`Defautsp`
LEFT JOIN `E_S` ON `E_S`.`Champs2` = `Defautsp`.`Champs1`
)
LEFT JOIN `moteur` ON `moteur`.`Champs0` = `Defautsp`.`Champs1`
)
LEFT JOIN `trappe` ON `trappe`.`Champs0` = `Defautsp`.`Champs1`
)
LEFT JOIN `B2d` ON `B2d`.`Champs0` = `Defautsp`.`Champs1`
WHERE
`Defautsp`.`Champs0` <> ''
AND `Defautsp`.`Champs1` <> ''
)
UNION ALL
(
SELECT
'' AS `adresse_defaut`,
`E_S`.`Champs2` AS `symbole_element`,
`E_S`.`Champs5` AS `commentaire`,
`E_S`.`Champs6` AS `nom_machine`,
`E_S`.`Champs4` AS `type_element`,
'' AS `entree1`,
'' AS `entree2`,
'' AS `sortie1`,
'' AS `sortie2`
FROM
`E_S`
LEFT JOIN `Machines` ON `Machines`.`Champs0` = `E_S`.`Champs4`
WHERE
`E_S`.`Champs2` <> ''
) |
Partager