---
title: "mysql 正则表达式查询"
author: "sinykk"
date: "2010-11-30T13:25:55Z"
tags: ["HTML", "MySQL", "正则表达式"]
categories: ["数据库"]
slug: "mysql"
draft: false
lastmod: "2010-11-30T13:25:55Z"
id: 829223
url: "https://sinykk.iteye.com/blog/829223"
---

六位代码的地区，只查出市级别

 

SELECT * from util\_area where code regexp '\[0-9]{2}\[^(00)]{1}00$'

 

更多正则参考 http://dev.mysql.com/doc/refman/5.1/zh/regexp.html