I want to delete the last row from the table that satisfies some condition.
DELETE TOP 1 FROM SOME_TABLE
WHERE SOME_COULMN = @VALUE
ORDER BY 1 DESC
DELETE FROM SOME_TABLE
WHERE UNIQUE_ID =
(SELECT TOP 1 UNIQUE_ID
FROM SOME_TABLE
WHERE SOME_COLUMN = @VALUE
ORDER BY SOMETHING DESC)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With