I have a table and I need to retrieve the ID of the Second row. How to achieve that ?
By Top 2 I select the two first rows, but I need only
Top 2
No need of row number functions if field ID is unique.
SELECT TOP 1 * FROM ( SELECT TOP 2 * FROM yourTable ORDER BY ID ) z ORDER BY ID DESC