Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 19 Jan 2006 @ 11:17:48 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Differences between queries
 
From:   Joseph V D silva

These two SQLs have different meanings.

Logically this is what happens (you can probably try explain to verify that)

(1) In the first case, teradata ( and for that matter any database ) will select all rows from sales_order table for which order_line_id is NULL and the left outer join is performed only for this subset of sales_order table with the order_line table.

(2) In the second case the left outer join is performed first (where clause is not applied) and then of the resultant set, the condition order_line_id is NULL is applied to select the rows from the result set (which is the where clause).


The difference is that when you specify conditions in the join clause it's applied first before the join where as when you are specifying the conditions in the where clause, it's applied only after the join, on the result set.

Joseph Vinish D'silva



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023