Hi,
I want to generate one column as Sl.No. (Question column in below data) This column has to generate based on the group by rows.
For Example,
In "A" group, i have 4 Rows. So want to generate 1,2,3,4.
In "B" group, i have 7 Rows. So i want to generate 1,2,3,4,5,6,7.
I want to generate "n" number of group dynamically.
How to do this in SQL Query..?
Example data:
-------------
ID Code Sl.No ? Role EmpNo
1000 A 1 Manager 9001
1002 A 2 Manager 9002
1003 A 3 Manager 9003
1004 B 1 Asst.Mgr 9004
1005 B 2 Asst.Mgr 9005
1006 B 3 Asst.Mgr 9006
1007 B 4 Asst.Mgr 9007
1008 B 5 Asst.Mgr 9008
1009 B 6 Asst.Mgr 9009
1010 B 7 Asst.Mgr 9010
1011 B 8 Asst.Mgr 9011
1012 C 1 Consultant 9012
1013 C 2 Consultant 9013
1014 C 3 Consultant 9014
1015 C 4 Consultant 9015
1016 C 5 Consultant 9016
1017 C 6 Consultant 9017