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';
↧