Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 16 Jun 2003 @ 16:02:59 GMT


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


Subj:   Re: Consecutive sequence sql logic
 
From:   John Dubery

Bruce,

I think you need to use MDIFF (Moving DIFFerence) to do this.

I tried:

sel acc1, count(*) from
(sel * from account_phone qualify mdiff(phone, 1, acc, phone) = 1)
diff1(acc1, phone1)
group by 1
having count(*) >3

Your data was in:

CREATE TABLE account_phone (acc integer, phone integer);

Does this seem OK?


Regards,

John



     
  <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