) AS `a`
GROUP BY `buch_id`;
+CREATE OR REPLACE VIEW v_buchserien AS
+SELECT s.`id` AS `serien_id`,
+ s.`serien_name` AS `serien_name`,
+ s.`descr` AS `serien_descr`,
+ sb.`buch_id` AS `buch_id`,
+ b.`title` AS `book_title`,
+ b.`title_original` AS `title_original`,
+ b.`untertitel` AS `untertitel`,
+ b.`verlags_id` AS `verlags_id`,
+ v.`name_short` AS `verlag_name_short`,
+ v.`name_long` AS `verlag_name_long`,
+ b.`orts_id` AS `orts_id`,
+ o.`name` AS `orts_name`,
+ b.`bindungsart_id` AS `bindungsart_id`,
+ bi.`art_name` AS `bindungsart`,
+ b.`isbn` AS `isbn`,
+ b.`buch_nr` AS `buch_nr`,
+ b.`ausgabejahr` AS `ausgabejahr`,
+ b.`druckjahr` AS `druckjahr`,
+ b.`seiten` AS `seiten`,
+ b.`preis` AS `preis`,
+ b.`waehrungs_id` AS `waehrungs_id`,
+ w.`waehrungs_kuerzel` AS `waehrungs_kuerzel`,
+ w.`waehrungs_name` AS `waehrungs_name`,
+ b.`kurzinhalt` AS `kurzinhalt`,
+ b.`notes` AS `notes`,
+ sb.`ord_num` AS `serie_buch_ord_num`
+ FROM `buch2serie` AS sb
+ RIGHT JOIN `serien` s ON s.`id` = sb.`serien_id`
+ LEFT JOIN `buecher` b ON sb.`buch_id` = b.`id`
+ LEFT JOIN `bindungsarten` bi ON b.`bindungsart_id` = bi.`id`
+ LEFT JOIN `verlage` v ON b.`verlags_id` = v.`id`
+ LEFT JOIN `orte` o ON b.`orts_id` = o.`id`
+ LEFT JOIN `waehrungen` w ON b.`waehrungs_id` = w.`id`
+ ORDER BY s.`serien_name`, sb.`ord_num`;
+
+
+
-- vim: noai : ts=4 fenc=utf-8 filetype=sql expandtab :