gpt4 book ai didi

android - Android 中的 Sqlite 删除查询语法

转载 作者:IT王子 更新时间:2023-10-29 06:20:58 24 4
gpt4 key购买 nike

我想写一个查询来从表中删除一行。我对写声明感到困惑。我需要一些帮助来写这篇文章。我在这里用普通的 sql 语句提供我的要求。

(伪代码)

delete from tablename where value =="string1" && value2 == "string2" && value3 == "string3";

我想用 Sqlite 语法为 android db.delete(tablename, whereclause, whereargs); 写这个。

非常感谢您的帮助。

最佳答案

更好的方法是使用

String where = "value1 = ?"
+ " AND value2 = ?"
+ " AND value3 = ?";
String[] whereArgs = {string1,string2,string3};

关于android - Android 中的 Sqlite 删除查询语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4095309/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com