我有一个简单的表,如下所示
id, target
-----------
1, test_1
2, test_2
3, test_3
4, testable
Run Code Online (Sandbox Code Playgroud)
我有一个简单的查询,如下所示:
select * from my_table where target like 'test_%'
Run Code Online (Sandbox Code Playgroud)
我期待的是前三个记录,但我得到了所有4条记录
下划线是一种模式匹配字符.试试这个:
select * from my_table where target like 'test[_]%'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
160 次 |
| 最近记录: |