|
Archives of the TeradataForumMessage Posted: Fri, 20 Feb 2004 @ 09:00:23 GMT
Hi all, This is a pretty basic question, but I'm having trouble understanding it (please be kind J). Given the following information: tbl1 has 2,500 rows tbl2 has 55,000,000 rows the UPI for both tables is col1 Will these two SQL statements yield the same results? sel a.c1,a.c2,a.c3 from tbl1 a left outer join tbl2 b on a.col1 = b.col1 and b.col1 is null; sel a.c1,a.c2,a.c3 from tbl1 a left outer join tbl2 b on a.col1 = b.col1 where b.col1 is null; If not could you explain why not. Doing an explain on both queries (stats have been collected), query 1 will take 7 + hours, and query 2 will take just over 2 minutes. By those results, I have a feeling that I may not get the same results I'm looking for.
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||