Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Filter consecutive records that have same value as preceding record - response (1) by mohan.mscss

$
0
0
Here it is... sel csum(1,c1) ,con_rec.* ,min(c2) over (rows between 1 preceding and 1 preceding) as a , min(c3) over (rows between 1 preceding and 1 preceding) as b ,case when c2=a and c3=b then 'n'else 'y' end as res from con_rec qualify res='y';

Viewing all articles
Browse latest Browse all 14773

Trending Articles