title: unequal columns in two different select clause used union clause
body: <p>unequal columns in two different select clause used union clause.</p>
  
  <p>In mysql, we should have same number of columns defined in select clauses in 2 queries with UNION clause.</p>
  
  <p>so, to acheive the above, i am doing its like this:</p>
  
  <pre><code>SELECT col1, col2, col3, col4
  FROM table1
  {whereclause}
  UNION
  SELECT c1, c2, NULL, NULL
  FROM table2
  {whereclause}
  </code></pre>
  
  <p>but in my application at some places the no. of columns in first select clause is unkown to me, so couldn't hardcode <code>'NULL'</code>.</p>
  
  <p>one thing is constant i.e. in second <code>SELECT clause c1, c2</code> will remain same troughout, but i want to append <code>'NULL'</code> in select clause to match the equal number of columns in select clause 1.</p>
  
  <p>how can i acheive the above.</p>
  
  <p>thanks in advance.</p>