Android数据库update方法参数的问题
迷茫
迷茫 2017-04-17 17:28:30
0
2
597

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

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(2)
刘奇

If you know a simple sql statement, the explanation of the third parameterwhere id = 第四个参数 1
api is the optional WHERE clause to apply when updating. Passing null will update all rows. The fourth You may include ?s in the where clause, which will be replaced by the values ​​from whereArgs. The values ​​will be bound as Strings.
You can take a look at the Chinese version of this official document

迷茫

The third parameter is the conditional value of the updatesql语句的条件名,第四个参数是updatesql statement

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!