Skip to Content
0

How do I get the row_number in a calculated view?

Oct 25, 2016 at 04:14 PM

22

avatar image
Former Member

Good Day.

I have this simple query:

select yr_mth_nbr, sum(Txn_amt), row_number() over (order by yr_mth_nbr) as rob from tb_c2_zz5_dlvry_chnl_m_ddp where yr_mth_nbr>='201511' group by yr_mth_nbr;

Which returns:

YR_MTH_NBR;SUM(TXN_AMT);ROB
201511; 30,032.13; 1
201512; -254,763.77; 2
201601; 40,074.39; 3
201602; -407,180.09; 4

This is the result set I wish to get. How do I perform this same sql logic in a calculated view?

Thank you in advance for any assistance.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers