Skip to Content
avatar image
Former Member

How do I get the row_number in a calculated view?

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:

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

0 Answers