0

In Room database, If I have a query like this

SELECT * FROM table_name WHERE column_name LIKE '%' || :param || '%'

and the value of param is % or _, then all records in this table will be fetched.

I want to search in this column by the value of these chars not use them as wildcards, how to do this?

atabouraya
  • 3,123
  • 1
  • 25
  • 29
Islam Khaled
  • 199
  • 2
  • 9
  • It's not typically duplicated as things are not the same in Room but I found the solution appending `\\` before `%` and `_` and escape only one backslash `SELECT * FROM table_name WHERE column_name LIKE '%' || :param || '%' escape '\'` – Islam Khaled Nov 10 '21 at 12:23

0 Answers0