Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 21 Nov 2014 @ 10:27:20 GMT


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


Subj:   Re: Understanding JOINS
 
From:   Dave Wellman

Hi,

Some possible answers to your questions:

1) BETWEEN is a valid join. Whether it is right or not depends on the question you are trying to answer. Yes, it will probably result in more rows meeting the join criteria compared to an equality join for a single value, but it is still valid.

2) No, I can't see any reason for the CAST function. The DATE keyword already has a data type of DATE.

3) If you have to use CAST in a join then that implies (to me) that the underlying data types are not consistent. This comes back to the physical data model and I would question if that is correct. I find a CAST in a WHERE clause is more often valid, for instance when selecting against a constant 'high values' date or timestamp. (WHERE END_DATE = DATE '2999-12-31'). Note that there is no requirement to actually code a CAST function, the dbms will do it anyway.


Cheers,

Dave

Ward Analytics Ltd - Information in motion (www.ward-analytics.com)



     
  <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