---
title: "让mysql区分大小写的方法"
author: "tomfish88"
date: "2013-11-29T09:31:20Z"
tags: []
categories: ["数据库"]
slug: "mysql"
draft: false
lastmod: "2013-11-29T09:31:20Z"
id: 1982724
url: "https://tomfish88.iteye.com/blog/1982724"
---

要让mysql查询区分大小写，可以： 

 
select  * from  table_name where  binary  a like  'a%'   
select  * from  table_name where  binary  a like  'A%'   
 


也可以在建表时，加以标识 

 
create  table  table_name(  

     a varchar (20) binary

)