房间查询替换(replace(...))

时间:2019-04-11 15:53:37

标签: android sqlite android-room android-architecture-components

@Query("SELECT * FROM MyObject WHERE REPLACE(name, ' ', '') LIKE :name")
fun find(name: String): MyObject

这是可行的,但是如果我添加更多的REPLACE(),它将无法正常工作

@Query("SELECT * FROM MyObject WHERE REPLACE(REPLACE(name, ' ', ''), '_','') LIKE :name")
fun find(name: String): MyObject

0 个答案:

没有答案