表结构如下:
| batch_no | userId | userName | createTime | travelerIds |
|---|---|---|---|---|
| 20160712-0023 | 321 | 系统管理员 | 2016-07-12 21:34:50 | 1,11,12 |
travelerIds是多个travelerId用逗号连接起来的字符串
如果需要查询包含有travelerId等于1的记录,该查询语句怎么写?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
mysql 有一个 FIND_IN_SET 函数 可以去看一下
travelerId必须用逗号分隔
可以使用正则表达式。
比如: