Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- `bil_aargang`,
- `land_navn`,
- `model_navn`,
- `maerke_navn`,
- `braendstof_navn`,
- COALESCE(`bd1`.`data_float`, `bd1`.`data_int`, `bd1`.`data_varchar`) AS `motor`,
- COALESCE(`bd2`.`data_float`, `bd2`.`data_int`, `bd2`.`data_varchar`) AS `heste`,
- COALESCE(`bd3`.`data_float`, `bd3`.`data_int`, `bd3`.`data_varchar`) AS `acceleration`
- FROM
- `bil` AS `b`
- LEFT JOIN `bil_data` AS `bd1` ON `b`.`bil_id`=`bd1`.`bil_id` RIGHT JOIN `attribut` AS `a1` ON `a1`.`attribut_id`=`bd1`.`attribut_id` AND `a1`.`attribut_navn`='motor'
- LEFT JOIN `bil_data` AS `bd2` ON `b`.`bil_id`=`bd2`.`bil_id` RIGHT JOIN `attribut` AS `a2` ON `a2`.`attribut_id`=`bd2`.`attribut_id` AND `a2`.`attribut_navn`='heste'
- LEFT JOIN `bil_data` AS `bd3` ON `b`.`bil_id`=`bd3`.`bil_id` RIGHT JOIN `attribut` AS `a3` ON `a3`.`attribut_id`=`bd3`.`attribut_id` AND `a3`.`attribut_navn`='acceleration'
- NATURAL JOIN `model`
- NATURAL JOIN `maerke`
- NATURAL JOIN `braendstof`
- NATURAL JOIN `land`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement