In the Android Rooms persistence library, how would I write the following SQL statement as a @Query?
SELECT * FROM table WHERE field LIKE %:value%
This syntax is invalid, and I can't find anything about it in the documentation.
In the Android Rooms persistence library, how would I write the following SQL statement as a @Query?
SELECT * FROM table WHERE field LIKE %:value%
This syntax is invalid, and I can't find anything about it in the documentation.
The answer by yigit works great for me:
@Query("SELECT * FROM stores " +
"WHERE name LIKE '%' || :search || '%' " +
"OR description LIKE '%' || :search || '%'")