Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 31 Oct 2012 @ 21:07:06 GMT


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


Subj:   Re: OVERLAPS question
 
From:   Dieter Noeth

Hi Geoffray,

don't mess with Standard SQL :-)

This formula is directly copied from the standards and there are some more rules, i doubt you can prove it's wrong:

4) If D1 is the null value or if E1 < D1, then let S1 = E1 and let T1 = D1. Otherwise, let S1 = D1 and let T1 = E1.

5) Case:

a) If the most specific type of the second field of is a datetime data type, then let E2 be the value of the second field of .

b) If the most specific type of the second field of is INTERVAL, then let I2 be the value of the second field of . Let E2 = D2 + I2.


6) If D2 is the null value or if E2 < D2, then let S2 = E2 and let T2 = D2. Otherwise, let S2 = D2 and let T2 = E2.

7) The result of the is the result of the following expression:

     ( S1 > S2 AND NOT ( S1 >= T2 AND T1 >= T2 ) )
     OR ( S2 > S1 AND NOT ( S2 >= T1 AND T2 >= T1 ) )
     OR ( S1 = S2 AND ( T1 <> T2 OR T1 = T2 ) )

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