title: use month names instead of numbers, in union select mysql
body: <p>First, I just used union, and I don't really understand it.
  basically, to change the name of the month I usually use</p>
  
  <pre><code>select MONTHNAME (date) 
  </code></pre>
  
  <p>But in this case I dont know Union more deeply so it is very confusing to change the number of months to the name of the month. Can you help me? please don't just give an answer but please also include an explanation.</p>
  
  <p>this my query, and fyi this query was helped by the 'sticky bit' in my previous topic.</p>
  
  <pre><code>SELECT m.month month_table,
         coalesce(s.count, 0) cstart,
         coalesce(e.count, 0) cend
         FROM (SELECT 1 month
               UNION ALL
               SELECT 2 month
               UNION ALL
               SELECT 3 month
               UNION ALL
               SELECT 4 month
               UNION ALL
               SELECT 5 month
               UNION ALL
               SELECT 6 month
               UNION ALL
               SELECT 7 month
               UNION ALL
               SELECT 8 month
               UNION ALL
               SELECT 9 month
               UNION ALL
               SELECT 10 month
               UNION ALL
               SELECT 11 month
               UNION ALL
               SELECT 12 month) m
              LEFT JOIN (SELECT month(n.start_date) month,
                                count(*) count
                                FROM newdata n
                                GROUP BY month(n.start_date)) s
                        ON s.month = m.month
              LEFT JOIN (SELECT month(n.end_date) month,
                                count(*) count
                                FROM newdata n
                                GROUP BY month(n.end_date)) e
                        ON e.month = m.month
         ORDER BY m.month;
  </code></pre>
  
  <p>I have tried to replace all 'month' to 'monthname' but the results is 0.</p>
  
  <p>Before i change month to monthname</p>
  
  <pre><code> month_table|cstart|cend
        1      |  1   |  0
        2      |  0   |  1
        3      |  0   |  0
        4      |  0   |  0
        5      |  0   |  0
        6      |  0   |  0
        7      |  0   |  0
        8      |  1   |  0
        9      |  0   |  0
        10     |  1   |  2
        11     |  0   |  0
        12     |  0   |  0
  </code></pre>
  
  <p>and when i change month to monthname the results be</p>
  
  <pre><code>month_table|cstart|cend
        1      |  0   |  0
        2      |  0   |  0
        3      |  0   |  0
        4      |  0   |  0
        5      |  0   |  0
        6      |  0   |  0
        7      |  0   |  0
        8      |  0   |  0
        9      |  0   |  0
        10     |  0   |  0
        11     |  0   |  0
        12     |  0   |  0
  </code></pre>