Hi guys, I just made a request to get the second last row from the database
Here is the code:
SELECT TOP 1 * FROM
(select Top 2 * from Categories ORDER BY CategoryID DESC) x
ORDER BY CategoryID
but this code gives me an error syntax error in the new version.
in the old version, this code works fine.
what's the problem, that I have 10 results in the table, and when I send this query, give me 9 rows, but when 9 rows are removed from the table, now I have 8 and 10, but this code gives me 10 not earlier, please help in advance
source
share