title: Left Joining With Some default values
body: <p>I am trying to build a query which will take some default values and will left join with a table. This just to allow at least one result in case the main query(2nd) one doesn't match to any row and thus might return empty result set <a href="https://stackoverflow.com/questions/22549331/getting-empty-results-for-count-group-by-mysql-query">as mentioned on my another question</a>. </p>
  
  <p>my query is pretty much as follows:</p>
  
  <pre><code>SELECT * FROM(
      (SELECT 'test' as `column1`, 'test' as `column2`, 0 as c) t1
      LEFT JOIN
          (SELECT `column1`, `column2`, COUNT(*) as c
          FROM `my_table`
          WHERE `status` = 1
          GROUP BY column1, column2) t2
  )
  </code></pre>
  
  <p>Its showing up a mysql error on phpmyadmin as below:</p>
  
  <pre><code>#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't2 )' at line 7
  </code></pre>
  
  <p>What is wrong with the query please?</p>