Home Forums SQL Server 2008 SQL Server 2008 - General Query to delete nth row in a table (SQL Server 2008 Express) RE: Query to delete nth row in a table (SQL Server 2008 Express)
luckysql.kinda
SSCertifiable
Points: 7816
More actions
March 3, 2011 at 5:53 pm
#1294411
try this
BEGIN TRAN test
DELETE tablename
FROM (SELECT Column
FROM
(
SELECT column/s, row_number() over(ORDER BY getdate()) as r
FROM tablename
) as t
WHERE r = 4)tmp
INNER JOIN tablename
ON tablename.column = tmp.column
COMMIT TRAN test