Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个充满邮政编码的数据库,我正在创建一个查找邮政编码前缀的搜索,例如:
AB, BR, G, GU
现在我无法解决的问题,我尝试了各种LIKE,但似乎无法解决。RLIKEREGEXP
LIKE
RLIKE
REGEXP
如果您搜索G我希望它只返回G1等G2。它目前正在做的是输出G1, G2, GU1,GU2我怎样才能阻止它显示GU结果?
G
G1
G2
GU1
GU2
GU
select * from your_table where postcode REGEXP 'G[0-9]+'