I have a table which contains:
ID ID_TYPE
---------------
1 0
2 1
3 1
Now I want to get the current record number when performing:
SELECT ID
FROM IDTable
WHERE ID_TYPE = 1
I don't want to use ROW_NUMBER() OVER (ORDER BY [ID] desc)
, because it's very slow when using larger tables.
What are my alternatives ?