Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

adding left joins changes results

$
0
0
i have simple query with left join 

select x.id , count(y.xid)
from x
left join y on y.xid = x.id
group by x.id 

this qouery gives me the correct results
but the same query with more left joins return different results

select x.id , count(y.xid)
from x
left join y on y.xid = x.id
left join z on z.xid = x.id
left join t on t.xid = x.id
group by x.id 


does this make any sence?
 

Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>