title: SQL - Naming conditions for filtering
body: <p>I wrote MySQL query to filter and count items in a table by date and now a need to get results like:</p>
  
  <pre><code>+-----+--------------------+
  | cnt | creation_date_date |
  +-----+--------------------+
  | 90  | 2019-11-15         |
  | 31  | 2019-11-16         |
  | 9   | 2019-11-17         |
  | 80  | 2019-11-18         |
  | 40  | 2019-11-19         |
  | 32  | 2019-11-20         |
  | 132 | 2019-11-21         |
  +-----+--------------------+
  </code></pre>
  
  <p>and i got: </p>
  
  <pre><code>+-----+
  | cnt |
  +-----+
  | 1   |
  | 1   |
  | 1   |
  | 1   |
  | 1   |
  | 1   |
  | 1   |
  | 1   |
  +-----+
  </code></pre>
  
  <p>I don't know where to declare name <code>creation_date_date</code> in mine condition?</p>
  
  <p>My query:</p>
  
  <pre><code>SELECT COUNT(*) as cnt
  FROM wallet
  WHERE created &gt;= CAST('2019-11-15' AS DATE) 
  AND created &lt;= CAST('2019-12-06' AS DATE)
  GROUP BY created
  </code></pre>