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

Need Analytical window query help - response (6) by Sayandeep

$
0
0

SEL ID , STATUS , DT , MAX(STATUS) OVER(PARTITION BY ID ORDER BY DT ROWS 1 PRECEDING) AS COL1 ,  MIN(STATUS) OVER(PARTITION BY ID ORDER BY DT ROWS 1 PRECEDING) AS COL2 , CASE WHEN COL2 <> COL1 THEN 1 ELSE 0 END AS COL3 FROM MY_TABLE;


Viewing all articles
Browse latest Browse all 14773

Trending Articles



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