Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 16 Jul 2007 @ 16:47:13 GMT


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


Subj:   Re: Selecting date without quotes
 
From:   Dieter Noeth

Just explain it:

     EXPLAIN
     SELECT * FROM sys_calendar.calendar
     WHERE calendar_date = 3908-07-16;

        1) First, we do a single-AMP RETRIEVE step from SYS_CALENDAR.CALDATES
           by way of the unique primary index "SYS_CALENDAR.CALDATES.cdate =
           3885" with no residual conditions.  The estimated time for this
           step is 0.01 seconds.

Btw, neither "col1 = '2007-07-16'" nor "col1 = 1070716" are the recommended way to supply a date, the first one might fail, if the col1 format changes and the second one is hard to understand.

The correct one is "col1 = DATE '2007-07-16'", because it's always expecting an international standard date 'YYYY-MM-DD' regardless of the column format.


Dieter



     
  <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