I am trying to join 2 tables, however I want every data row in table 1 to be shown even if table 2 does not have the corresponding data.
select a.name, b.price, c.units from #a
join #b with (nolock) on b.id=a.id
where b.date = '12/31/2010'
group by name, price, units
order by units
in this query, if there are 20 entries in a, and 16 corresponding entries in b, only 16 entries will be shown. I am trying to make it show all 20 entries even if the data in a can't be joined to b.