Android数据库update方法参数的问题

【字号: 日期:2022-12-11浏览:29作者:雯心

问题描述

update方法的第三第四个方法自己琢磨了半天还是没弄懂,可以举几个例子具体说明一下第三第四个参数吗比如这样一张表id name age garden 1 Tom 15 62 Mike 16 63 Tim 15 7比如我要让所有grade为6的age修改为15应该怎么写?想让所有age为15的name为Tom又应该怎么写?

问题解答

回答1:

如果会简单的sql语句,第三个参数 where id = 第四个参数 1api 的解释 第三个 the optional WHERE clause to apply when updating. Passing null will update all rows.第四个 You may include ?s in the where clause, which will be replaced by the values from whereArgs. The values will be bound as Strings. 你可以看一下这个官方文档中文版

回答2:

第三个参数是update时sql语句的条件名,第四个参数是update时sql语句的条件值

相关文章: