title: SQL: Get Value of Column in table 1 from table 2
body: <pre><code>Table 1(Validproduct):                 Table 2(Registredproduct):
  
  ProductId  Name                         ID ProductId Quantity REGISTRATIONID              
  1           chair                        1 2          10      1111
  2           table                        2 2          11      2222        
  3           desk
  </code></pre>
  
  <p>What I am looking for is below result for customer id 1111</p>
  
  <pre><code>Name  Quantity 
  Table    10
  Chair    0
  Desk     0
  </code></pre>
  
  <p>I tried this but it only gives me product which exists in Registredproduct</p>
  
  <pre><code>SELECT vp.name as 'Product', rp.quantity as 'quantity'
         FROM Validproduct vp 
         Left JOIN RegistrationProduct rp on 
         vp.ValidproductID = rp.ValidproductID 
         WHERE REGISTRATIONID = 1111
      enter code here
  </code></pre>
  
  <p>and get this result</p>
  
  <pre><code> Name  Quantity 
   Table    10
  </code></pre>