How to check for uppercase letters in MySQL?

前端 未结 4 2000
再見小時候
再見小時候 2021-01-01 17:15

I want to check, if a string consits only of uppercase letters. I know that RLIKE/REGEXP are not case sensitive in MySQL. So I tried to use the :upper: characte

4条回答
  •  粉色の甜心
    2021-01-01 17:52

    This worked for me to get the list of rows having only upper case characters:

    SELECT 
        name, UPPER(name) 
    FROM table 
    WHERE 
        BINARY name = BINARY UPPER(name)
    ;
    

提交回复
热议问题