I am perplexed by the following issue. I am doing a left outer join and it’s returning MORE rows than no join at all.
select COUNT(*) specimen_id from QuickLabDump a
left outer join PracticeandPhysician c
on (a.[Requesting Physician]=c.doctorfirstname+' '+c.DOCTORLASTNAME
and a.[practice code]=c.practicecode)
where
DATEPART(mm, [DATE entered]) =12
and
DATEPART(yy, [DATE entered])=2011
yields 108387
whereas
select COUNT(*) specimen_id from QuickLabDump a
where
DATEPART(mm, [DATE entered]) =12
and
DATEPART(yy, [DATE entered])=2011
yields 108357
Shouldn’t they be returning the same exact amount of rows?
Second table may have more rows per 1 row in main table, thats the point