-- 匹配数字开头--
select t.member_mobile from shopnc_member_custom t where t.member_mobile REGEXP '^[0-9]';
-- 匹配字母开头--
select t.member_mobile from shopnc_member_custom t where t.member_mobile REGEXP '^[a-z]';
结果
本文介绍了如何使用正则表达式进行数据库查询,包括匹配数字和字母开头的字符串等场景,为开发者提供了一种灵活的数据筛选方式。
-- 匹配数字开头--
select t.member_mobile from shopnc_member_custom t where t.member_mobile REGEXP '^[0-9]';
-- 匹配字母开头--
select t.member_mobile from shopnc_member_custom t where t.member_mobile REGEXP '^[a-z]';
结果
1238

被折叠的 条评论
为什么被折叠?