我有一个具有结构的表(用户)
+-----+----------+------------+
|ID |firstName |lastName |
+-----+----------+------------+
|1 |John |Wesley |
+-----+----------+------------+
|2 |Ashley |Copper |
+-----+----------+------------+
搜索查询“ n W”应在表中显示“ John Wesley”,而“ y C”应在表中显示“ Ashley Copper”。
答案 0 :(得分:1)
最后得到了答案,
SELECT * FROM User WHERE ((firstName||" "||lastName) LIKE %query%)
答案 1 :(得分:0)
请尝试以下操作:-
Select firstName,lastName from user where (firstName like "%y" and lastName like "C%") or (firstName like "%n" and lastName like "W%")
答案 2 :(得分:0)
对Room Dao方法使用以下查询-
SELECT user.firstName || user.lastName AS 'FULL_NAME' FROM User;