From: Frank Brehm Date: Sun, 27 Feb 2011 10:49:41 +0000 (+0000) Subject: View v_buchserien erstellt X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=c1e3cab9eb724fb8b3bb3c2fdb1a3134c4126d8e;p=books.git View v_buchserien erstellt --- diff --git a/db/create_v_buchliste.sql b/db/create_v_buchliste.sql index 5c69342..ed9a785 100644 --- a/db/create_v_buchliste.sql +++ b/db/create_v_buchliste.sql @@ -71,5 +71,43 @@ SELECT `buch_id`, ) 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 :