title: SQL : Command Create Virtual Row If Not Exist
body: <p>It is possible in MySQL to create new virtual row if the data doesn't exist, depending on user condition? <br>
  My query looks like this:</p>
  
  <pre><code> SELECT year, value, type FROM myTable 
   WHERE year BETWEEN ( '2010' AND '2013') AND type IN ('Oil', 'Gas');
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>   year | value | type
    ---------------------
     2013  |  0    | Oil
     2012  | 144.5 | Oil
     2012  | 434.3 | Gas
     2011  | 141.0 | Oil
     2011  | 1234  | Gas
     2010  | 4567  | Gas
    ---------------------
  </code></pre>
  
  <p>I want to run a query that will output records like this: </p>
  
  <pre><code>    year | value | type
    ---------------------
     2013  |  0    | Oil
     2013  |  0    | Gas  // -&gt; new virtual* row
     2012  | 144.5 | Oil
     2012  | 434.3 | Gas
     2011  | 141.0 | Oil
     2011  | 1234  | Gas
     2010  | 4567  | Gas
     2010  | 0     | Oil // -&gt; new  virtual* row
    ---------------------
  </code></pre>
  
  <p>The user want to display both 'Gas' and 'Oil', but since year 2013  only contain type 'Oil', so I want to create new record for 'Gas' with 0 value then same goes with year '2010' (based on the desired output above).</p>
  
  <p>EDIT:</p>
  
  <pre><code>   CREATE TABLE `myTable` (
     `id` int(11) NOT NULL AUTO_INCREMENT,
     `type` varchar(15) DEFAULT NULL,  
     `year` year(4) DEFAULT NULL,
     `value` varchar(50) DEFAULT NULL,
      PRIMARY KEY (`id`)
     ) ENGINE=InnoDB AUTO_INCREMENT=92278 DEFAULT CHARSET=latin1
  </code></pre>