f1 f2 A 1 A 2 A 3 B 1 B 2 B 3
Sl.No F1 F2 1 A 1 2 A 2 3 A 3 1 B 1 2 B 2 3 B 3
select (rank() OVER(ORDER BY [f2])) as SerialNo,f1,f2 from TableA
Select Row_Number() Over(Partition by f1 Order by f2) as [Sl.No],f1 as [F1],f2 as [F2] From TableA
SELECT f2 AS [Sl.No], f1 AS F1, f2 AS F2 FROM A
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)