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

How to retrieve the Relative Record Number? - response (4) by KS42982

$
0
0
If I understood you correctly, then below solution would solve your problem. SELECT a.blank8, b.rownum ( SELECT -- add PK , CAST(CAST(t.blank8 AS FORMAT'9(6)') AS CHAR(8)) FROM ji_core_v.keepH T WHERE NOT EXISTS(SELECT * FROM SYS_CALENDAR.CALENDAR C WHERE CAST(CAST(t.blank8 AS FORMAT'9(6)') AS CHAR(8)) = C.CALENDAR_DATE (FORMAT 'YYYYMMDD' ) (CHAR(8)) ) ) a INNER JOIN ( SELECT -- add PK, CAST(CAST(t.blank8 AS FORMAT'9(6)') AS CHAR(8)), ROW_NUMBER() OVER (ORDER BY /*whatever you want to order by*/) rownum FROM ji_core_v.keepH T ) b ON a.blank8 = b.blank8 AND /*a.PK = b.PK*/ 

Viewing all articles
Browse latest Browse all 27759

Trending Articles



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