Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

SQL to compare records (status change) in table - response (1) by gfuller40

$
0
0
I figured it out.   select row_begin_dt, c_ams_clm, c_clm, c_sta_clm, -- Find the c_sta_clm of the previous row max(c_sta_clm) over (partition by c_clm order by row_begin_dt rows between 1 preceding and 1 preceding) as prev_c_sta_clm from pearl_p.TLTC900_CLM_PRSST -- Include only records which have a c_sta_clm different to that of the previous row qualify c_sta_clm <> prev_c_sta_clm

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>