– 不是以数字开头
select * from mot_terms where `name` not REGEXP '^[0-9]'
– 不是以字母开头
select * from mot_terms where `name` not REGEXP '^[a-zA-Z]'
– 已数字和特殊字符开头
select * from mot_terms where `name` REGEXP '^[@#$%&0-9]'
mysql查询以字符串开头的数据可以有:
1、select * from a where a.name like 'H%'
2、select * from a where left(a.name, 1)='H';
mysql查询不以某个字符串开头:
select * from a where left(a.name, 1)<>'H';