|
Archives of the TeradataForumMessage Posted: Tue, 04 Jan 2011 @ 07:36:16 GMT
Hi, This is simply because your id (the joining column) in first table have more than one recs in second table. For eg. First table has below values emp_id name 1 a Second table have below values emp_id name 1 b 1 c 1 ? 1 b Now the result of below query will 4, because for each matching value it will count the corresponding row in second table sel count(*) from first a left join second b on a.emp_id=b.emp_id Incase you join on emp_id and name both then the count(*) will give 1(values for corresponding row of second table will null).If you give where (b.emp_id is not null and b.name is not null) then left join will work as inner join. Regards Meenakshi
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||