mysql 过滤查询(以字母开头,以数字开头,非数字开头,非字母开头)

  • Post author:
  • Post category:mysql



— 不是以数字开头




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]’