title: Creating a view with a case
body: <p>I keep getting errors with the code but cannot see why. I'm very new to mysql so apologies in advance.</p>
  <p>I want to pull data from a table and perform several cases on the data but I keep getting errors. Could anyone help me what i'm doing wrong.</p>
  <pre><code>  CREATE VIEW myView3 AS (
    SELECT 
      freight,
      DATEDIFF(now(),shipping_date) AS days_in_transit,
      DATEDIFF(now(),shipping_date) AS transit_status
      CASE 
      WHEN transit_status &gt; 5 then &quot;Problem&quot;
      ELSE &quot;In transit&quot;
      END
    FROM tracking
  );
  </code></pre>
  <p>The code works fine when I remove the case</p>
  <p>Thanks in advance</p>