【发布时间】:2018-03-06 19:24:06
【问题描述】:
我在mysql 中有一个表,列名为type。内容如下
Type
Test 12
Test abc
start 1
start abcd
end 123
现在我想选择type以Test开头的记录
预期结果:
Test 12
Test abc
但我得到了任何一个
测试 12 或清空结果
我试过如下:
select * from table where type = 'Test 12'
select * from table where type = '%Test%'
select * from table where type = '%Test'
正确的sql 语句应该是什么。
【问题讨论】:
标签: mysql sql string select substring