Android Delete Query

前端 未结 3 1236
北恋
北恋 2020-12-02 02:29

I\'m attempting to delete all rows in one table that do not have a corresponding ID in another table. Since apparently SQLite does not support joins in deletes I am trying

相关标签:
3条回答
  • 2020-12-02 02:53

    I think the only way is to execute your select and dynamically combine your WHERE clause.

    0 讨论(0)
  • 2020-12-02 02:53

    you have to use execSQL instead rawQuery because rawQuiery is used for the statement that returns data and execSQL is used for the statement that doesn't return data like DELETE

    0 讨论(0)
  • 2020-12-02 03:03

    You shouldn't use a .rawQuery, as you stated, but you can use .execSQL() to accomplish it. I regularly use it for deletions myself.

    0 讨论(0)
提交回复
热议问题