I have data in a netezza database table column as follows:
Slno Ads
1 282542
2 2492266
3 2259286
4 2072619
5 1915098
6 11567811
7 10097
8 5900
9 2572
10 18569
Now I need to write a sql query that computes
Slno 6 / Slno 1 i.e 11567811/282542
Slno 7 / Slno 2 i.e 10097/2492266
Slno 8 / Slno 3 i.e 5900/2259286
Slno 9 / Slno 4 i.e 2572/2072619
Slno 10/ Slno 5 i.e 18569/1915098
I will always have only 10 rows of data and similar division is required for the data set.
The computed values can be shown in a new column next to the Ads column.
Please let me know if the question is clear and you need any information.
Thanks