Delete Top Query

The DELETE TOP does the same thing as a SELECT TOP WHERE only the TOP number of rows is deleted.

This can be very useful when there are duplicate rows of data present.

Below is the syntax for Delete Top

DELETE TOP (1) FROM tableName WHERE condition

e.g. If we want to delete one of the duplicate rows for Users with userID 1 then we can do it following ways

DELETE TOP (1) FROM Users WHERE userID = 1