instr() function SQLITE for Android?

前端 未结 5 983
误落风尘
误落风尘 2020-12-11 23:59

I wanna do the following on my existing sqlite database on android which is kind a built like that colomns: id --- rule --- path --- someotherdata

A rule now e.g. co

5条回答
  •  囚心锁ツ
    2020-12-12 00:13

    Use underscore(_) in the LIKE pattern instead of percentage(%). Underscore will matches any single character in the value instead of the entire string sequence.

    "SELECT DISTINCT * FROM " + TABLE_RULES + " WHERE rule LIKE '_"+ value + "_' ORDER BY " + KEY_ID+ " DESC;"
    

    LIKE operators

提交回复
热议问题