title: Compare table one value with two different tables in postgresql
body: <p>There are three tables, A,B and C having common columns(name and number)</p>
  
  <blockquote>
    <ol>
    <li>Table A have 10 records(say x) which can be only from table B(say, y) and table C(say, z) (like, x = y+z).</li>
    <li>In table A, there are some records whose value is 0 (zero)</li>
    <li>I need to compare those zero value based records using column = name, with other two tables.</li>
    <li>And check the column "number" for the same "name" is also zero (0) in table B and table C?</li>
    </ol>
  </blockquote>
  
  <p>I tried to write the below sample query to test on my small set of 3 tables data- but for some reasons I am not able to get all the 10 records as a result?</p>
  
  <pre><code>SELECT a.name,a.number as A_number, b.number as B_number, c.number as C_number
  from A a, B b, C c
  WHERE a.name = b.name
  </code></pre>
  
  <p>The above query gives me data as follows in the sqlfiddle-</p>
  
  <p><a href="http://sqlfiddle.com/#!2/57f86/1" rel="nofollow">http://sqlfiddle.com/#!2/57f86/1</a></p>
  
  <p>In the above data- theres no record <code>name="hello"</code> 
  Can anyone please correct me where I am going wrong? and how to get the exact result? I need all the records from Table A. I know if I use left join it will populate all the left table data even if no match.</p>
  
  <blockquote>
    <p>Possibilities: Table A having records, some may be present in table B
    and some in table C, but not on both.</p>
  </blockquote>