title: Syntax error: WITH is not valid input in this position
body: <p>So I have this similar request</p>
  
  <pre><code>    WITH customers_in_usa AS (
          SELECT 
             customerName, state
          FROM
             customers
          WHERE
             country = 'USA'
      ) SELECT 
          customerName
      FROM
          customers_in_usa
      WHERE
          state = 'CA'
      ORDER BY customerName;
  </code></pre>
  
  <p>But when wrote it I caught an error: 'WITH is not valid input in this position' <a href="https://i.stack.imgur.com/E3xfO.jpg" rel="nofollow noreferrer">error_picture</a>. Can you help me to understand what's wrong in this code?</p>