Hi,
I having below sample table,
DECLARE @TBL TABLE (s_Name VARCHAR(10), s_Age INT)
INSERT INTO @TBL VALUES ('S-1', 12)
INSERT INTO @TBL VALUES ('S-2', 13)
INSERT INTO @TBL VALUES ('S-3', 14)
INSERT INTO @TBL VALUES ('S-4', 15)
SELECT * FROM @TBL
I m looking for a SELECT statement for below output (here total number of rows is 4) if total number of rows is 5 then 5 row with index starts at 5,
Index s_Name
s_Age
4 s-1 12
3 s-2 13
2 s-3 14
1 s-4 15