How to delete rows in SQLite with multiple where args?

前端 未结 6 1036
陌清茗
陌清茗 2021-02-01 04:59

I want to delete rows which satisfy any of multiple conditions.

For example, I pass a list of IDs, and I want to delete all rows with these IDs (IDs are uni

6条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-01 05:55

    I have done this using this :

    Sqlite Statement Syntax :

    db.delete(TABLE_NAME,"COLUMN IN (?)", new String[]{commaSaparatedString})
    

    Example based on question :

    String args = TextUtils.join(", ", ids);
    db.delete("rows","id IN (?)", new String[]{args})
    

提交回复
热议问题