Reputation: 320
I have a table(user) with the structure
+-----+----------+------------+
|ID |firstName |lastName |
+-----+----------+------------+
|1 |John |Wesley |
+-----+----------+------------+
|2 |Ashley |Copper |
+-----+----------+------------+
Search query 'n W' should results 'John Wesley' and 'y C' should results 'Ashley Copper' out fo the table.
Upvotes: 2
Views: 72
Reputation: 1326
Please try this:-
Select firstName,lastName from user where (firstName like "%y" and lastName like "C%") or (firstName like "%n" and lastName like "W%")
Upvotes: 0
Reputation: 320
Finally got the answer,
SELECT * FROM User WHERE ((firstName||" "||lastName) LIKE %query%)
Upvotes: 2
Reputation: 2564
Use the following query on your Room Dao method -
SELECT user.firstName || user.lastName AS 'FULL_NAME' FROM User;
Upvotes: 0