I need to select the nth row from a table and only that row.
I am doing this within a user defined function and therefore I don't think I can use temporary tables.
For example, I have:
ID -- Code -- Value
1 A 5
2 A 10
3 B 5
4 A 25
Given the table is ordered by ID, I want to retrieve only the row having the third Code "A". In this example, it would be the 4th row.
If anyone can provide some help, it's greatly appreciated.
Thanks in advance.
I am doing this within a user defined function and therefore I don't think I can use temporary tables.
For example, I have:
ID -- Code -- Value
1 A 5
2 A 10
3 B 5
4 A 25
Given the table is ordered by ID, I want to retrieve only the row having the third Code "A". In this example, it would be the 4th row.
If anyone can provide some help, it's greatly appreciated.
Thanks in advance.