如何删除sqlite中的行 [英] How to delete rows in sqlite
本文介绍了如何删除sqlite中的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
伙计们,
任何人都可以帮助我。
我在sqlite数据库中有一个表,其中包含61249行,我只需要873行,其余行必须删除。我尝试使用循环概念但不幸的是。我使用dbbrowser sqlite来访问此数据库。我们不能在这里使用循环可以解决这个问题。
Hi Guys,
can anyone help me in this.
I have a table in sqlite database which consists of 61249 rows in that i just need 873 rows rest of the rows have to be deleted. I tried it by using loops concept but unfortunately. I am using dbbrowser sqlite to access this database. we cant use loops here can any one solve this.
推荐答案
如果你在谈论这个DBBrowser [ ^ ]您可以使用它执行SQL语句。因此,您必须确定一个列标准,您可以通过该标准指定应删除的行,然后执行DELETE语句。
请参阅:
https://www.sqlite.org/lang_delete.html [ ^ ]
http://www.tutorialspoint.com/sqlite/sqlite_delete_query.htm [ ^ ]
示例:
If you're talking about this DBBrowser[^] you can execute SQL-statements with it. So you would have to identify a column-criterion by which you can specify the rows that should be deleted and then execute a DELETE-statement.
See:
https://www.sqlite.org/lang_delete.html[^]
http://www.tutorialspoint.com/sqlite/sqlite_delete_query.htm[^]
Example:
DELETE FROM tablename WHERE column1 < 100 OR column1 > 900
逻辑很简单。
从tablename中删除,其中id> 873
The Logic is simple.
delete from tablename where id>873
这篇关于如何删除sqlite中的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文