title: MYSQL "SELECT CASE" view syntax error
body: <p>I have a couple of views which use the SELECT CASE syntax.However when I create a back up scripts and try restoring I get syntax errors.Keep in mind however the view was sucessfully created in the first place.</p>
  
  <p>On of my several "SELECT CASE" syntax view is right here</p>
  
  <pre><code>DROP VIEW IF EXISTS `v_stockmovement` ;
  CREATE VIEW `v_stockmovement`   
  AS
  SELECT stock_mov.id AS ID,
  stock_category.stock_category_code AS categorycode,
  stock_mov_type,
  (SELECT CASE stock_mov_type 
  WHEN 1 THEN 'Stock Issue' 
  WHEN 2 THEN 'Stock Reorder'
  WHEN 3 THEN 'Stock Adjustment'
  ELSE '' END) AS stock_mov_typedesc,
  (SELECT stock_mov_unitcost * stock_mov_quantity) AS cost,
  stock_mov_comments
  FROM stock_mov
  INNER JOIN stock ON stock.stock_code = stock_mov.stock_mov_linkstockcode
  INNER JOIN stock_category ON stock_category.stock_category_code = stock.stock_linkcategory
  ; 
  </code></pre>
  
  <p>What could I be missing?</p>