当前位置:网站首页>Android Room数据库Like模糊查询
Android Room数据库Like模糊查询
2022-04-22 06:19:00 【许三多2020】
Android Room数据库Like模糊查询
1、模糊查询
模糊查询的一般用Like关键字:
//查询表user中的user_name 包含‘黄’字的user集合
select * from user where user_name like '%黄%'
2、Room中的模糊查询
Room中用||代替+号
示例:
// ||相当于+号
@Transaction
@Query("SELECT * FROM user WHERE user_name LIKE '%' || :searchName || '%' ")
fun queryUser(searchName: String): List<User>
3、参考
版权声明
本文为[许三多2020]所创,转载请带上原文链接,感谢
https://blog.csdn.net/Gary__123456/article/details/107850724
边栏推荐
- F. Find 3-friendly Integers (特殊数字 / 找规律) (2021牛客暑期多校训练营1)
- Blog synchronization update notification
- 278 · 绘制填充
- Codeforces Round #780 (Div. 3)
- Art de la programmation simultanée (9): utilisation finale et principes
- A. Weird Flecks, But OK (计算几何&三维最小圆覆盖)(2021年度训练联盟热身训练赛第一场)
- Codeforces Round #778
- 867 · 四键键盘
- L2-001 emergency rescue (extension of shortest Dijkstra - number of shortest paths & maximum weight of paths)
- L2-005 集合相似度(set判重)
猜你喜欢

363 · 接雨水

L2-001 emergency rescue (extension of shortest Dijkstra - number of shortest paths & maximum weight of paths)

A. Weird flecks, but OK (Computational Geometry & three-dimensional minimum circle coverage) (the first game of 2021 Training Alliance warm-up training competition)

C.Ducky Debugging(简单判断/签到)(2021年度训练联盟热身训练赛第五场 )

L1-064 AI core code valued at 100 million (20 points) has wrong format

A. Alice and Bob (game? Thinking & Violence) (2021 Niuke summer multi school training camp 1)

A.Binary Seating (概率) (2021年度训练联盟热身训练赛第五场)

Definition and difference between rewriting and overloading

Leetcode - 6 - (string multiplication, next larger element < Ⅰ Ⅱ Ⅲ >, K sets of inverted linked list)

D. Determine the Photo Position (简单找子串)(2021牛客暑期多校训练营1)
随机推荐
323 · string game
This关键字详细概述
A. Weird Flecks, But OK (计算几何&三维最小圆覆盖)(2021年度训练联盟热身训练赛第一场)
Leetcode - 1 - (substructure, combination, spiral matrix and full arrangement of tree < Ⅰ Ⅲ >)
SQL review, grammar notes, fresh out
Codeforces Round #634 (Div. 3)
C. Ducky debugging (Game 5 of 2021 training League warm-up training competition)
C language | bitwise operator
Codeforces Round #610 (Div. 2)
C.Ducky Debugging(简单判断/签到)(2021年度训练联盟热身训练赛第五场 )
Codeforces Round #623
1005 monopoly congruence solution (2021 Chinese college student programming competition CCPC network trial replay)
The art of concurrent programming (11): introduction to tool classes in JUC
2019.1.2 idea usage tutorial
L2-002 linked list weight removal (pit of test point 1)
Codeforces Round #588 (Div. 2) C D
L1-071 前世档案 (20 分) (类似二分)
Codeforces Round #780 (Div. 3)
L1-071 previous life files (20 points) (similar two points)
Leetcode - 2 - (parenthesis generation, longest palindrome string, ring linked list, reverse linked list, nodes in pairwise exchange linked list)