开发者

how to delete every alternate row in access table

开发者 https://www.devze.com 2022-12-21 12:06 出处:网络
i have a huge acces开发者_开发百科s table containing about 400000 rows . what sql query can i give to delete every alternate row in the table. ?

i have a huge acces开发者_开发百科s table containing about 400000 rows . what sql query can i give to delete every alternate row in the table. ?

I do have a column in the table which has values from 1 , 2, 3 ,4 .... about 400000 .


Try using Mod. Something like

DELETE Table1.*
FROM Table1
WHERE ((([ID] Mod 2)=0));


Assuming your table's name is "table", and your column with the line number is named "id", it would be

DELETE FROM table WHERE MOD(id,2)=0

Edit: Apparently, this is the wrong Syntax for MS Access. Use astanders solution below.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号