-- View: "v_label_export"

DROP VIEW "v_label_export";

CREATE OR REPLACE VIEW "v_label_export"
AS
SELECT l.makercd,
       m.makernm,
       l.labelcd,
       l.labelnm,
       l.labelnmkana,
       l.recommenddiv,
       CASE l.recommenddiv
          WHEN 1 THEN 'おすすめ'
          ELSE ''
       END AS recommenddivname
 FROM t_label l
      INNER JOIN t_maker m
         ON m.makercd = l.makercd
WHERE l.delflg = FALSE
ORDER BY m.makernmkana,
         m.makernm,
         l.labelnmkana,
         l.labelnm
;
