title: insert values of query into table, even if no result in query (insert 0 values)
body: <p>I am trying to solve a probably simple thing, being no expert at all @ mysql</p>
  
  <p>I have this first table 'online_players'</p>
  
  <pre><code>mysql&gt; show columns from online_players;
  +-------------------+--------------+------+-----+---------+-------+
  | Field             | Type         | Null | Key | Default | Extra |
  +-------------------+--------------+------+-----+---------+-------+
  | Agent             | varchar(255) | YES  |     | NULL    |       |
  | Name              | varchar(255) | YES  |     | NULL    |       |
  | Alias             | varchar(255) | YES  |     | NULL    |       |
  | Begin_Date        | varchar(100) | YES  |     | NULL    |       |
  | LastBalanceUpdate | varchar(100) | YES  |     | NULL    |       |
  | Session_minutes   | varchar(100) | YES  |     | NULL    |       |
  | Balance           | varchar(100) | YES  |     | NULL    |       |
  | Product           | varchar(100) | YES  |     | NULL    |       |
  +-------------------+--------------+------+-----+---------+-------+
  8 rows in set (0.04 sec)
  </code></pre>
  
  <p>which is droped, recreated and value inserted every 3 minutes, it shows players on a  website currently playing...</p>
  
  <p>I then have this table 'players_count' :</p>
  
  <pre><code>mysql&gt; show columns from players_count;
  +---------------+--------------+------+-----+---------+----------------+
  | Field         | Type         | Null | Key | Default | Extra          |
  +---------------+--------------+------+-----+---------+----------------+
  | date_count    | varchar(50)  | YES  |     | NULL    |                |
  | players_count | varchar(10)  | YES  |     | NULL    |                |
  | product       | varchar(10)  | YES  |     | NULL    |                |
  | avg_balance   | varchar(100) | YES  |     | NULL    |                |
  | id            | int(11)      | NO   | PRI | NULL    | auto_increment |
  +---------------+--------------+------+-----+---------+----------------+
  5 rows in set (0.07 sec)
  </code></pre>
  
  <p>When the table online_players is updated, the table players_count is updated with a specific insert:</p>
  
  <pre><code>USE livefeed;
  INSERT INTO players_count(
  date_count,players_count,product, avg_balance)
  SELECT
  now(),
  count(Name) as Players,
  Product,
  Avg(Balance)
  FROM
  online_players
  GROUP BY Product;
  </code></pre>
  
  <p>It works ok when at list 1 player is online:</p>
  
  <pre><code>mysql&gt; select * from players_count
      -&gt; ;
  +---------------------+---------------+---------+-------------+----+
  | date_count          | players_count | product | avg_balance | id |
  +---------------------+---------------+---------+-------------+----+
  | 2016-03-28 17:09:02 | 2             | USD     | 0.06        | 1  |
  | 2016-03-28 17:12:01 | 1             | USD     | 0.12        | 2  |
  | 2016-03-28 17:15:00 | 1             | USD     | 0.12        | 3  |
  | 2016-03-28 17:18:00 | 1             | USD     | 0.12        | 4  |
  | 2016-03-28 17:21:01 | 1             | USD     | 0.12        | 5  |
  | 2016-03-28 17:24:00 | 1             | USD     | 0.12        | 6  |
  +---------------------+---------------+---------+-------------+----+
  6 rows in set (0.21 sec)
  </code></pre>
  
  <p>But I would also like to record a row in table players_count when NO player is online even if my query above = 0, for example:</p>
  
  <pre><code>+---------------------+---------------+---------+-------------+----+
  | date_count          | players_count | product | avg_balance | id |
  +---------------------+---------------+---------+-------------+----+
  | 2016-03-28 18:01:00 | 0             | USD     | 0           | 7  |
  | 2016-03-28 18:01:00 | 0             | FUN     | 0           | 8  |
  </code></pre>
  
  <p>I use the table players_count to generate "real time" graphs and need to have 0 values for every specific date.</p>
  
  <p>It might be simple but I have not found any solution online...
  How shoud I modify my Insert/query to do this?
  Thanks for your help</p>