sql server - Can I delete multiple of nth rows in a single query from a table in SQL? -
i want delete multiple of 4 table have thousands of record. how can it?
ex:- table1 1 2 b 3 c 4 d 5 e 6 f 7 g 8 h 9
i want delete every 4th row.
i don't want use loop or cursor.
delete ( select *,row_number() over(order id) rn tablea ) rn%4=0
Comments
Post a Comment