title: mysql join 2 tables - show all rows from one table
body: <p>I have two tables, like so:
  table "a" contains:</p>
  
  <pre><code>id|name
  
  stock1|fullname
  stock2|fullname2
  stock3|fullname3
  </code></pre>
  
  <p>table "b" contains product quantities for given stock.</p>
  
  <pre><code>id|stock_id|quantity|product_id|
  1|stock1|3|13
  2|stock3|4|13
  3|stock1|1|5
  4|stock2|2|2
  </code></pre>
  
  <p>Now I would need to combine those two tables, so that each product takes its stock full name from table "a", and if its quanitity is not given for stock, it would still show the row with the quanitity as 0.</p>
  
  <p>So from my example, product_id 13 would show as:</p>
  
  <pre><code>stock|quanitity|product_id|stock_fullname
  stock1|3|13|fullname1
  stock2|0|13|fullname2
  stock3|4|13|fullname3
  </code></pre>