Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySql Query to Change a lower case to upper case

Tags:

string

sql

mysql

How to change all lower cases in a string to upper cases using MySql Query?

like image 375
ram kumar Avatar asked Sep 29 '12 11:09

ram kumar


People also ask

How do I change to uppercase in MySQL?

MySQL UPPER() Function The UPPER() function converts a string to upper-case. Note: This function is equal to the UCASE() function.

How do I change lower-case to higher case?

To use a keyboard shortcut to change between lowercase, UPPERCASE, and Capitalize Each Word, select the text and press SHIFT + F3 until the case you want is applied.

How do I change to lowercase in MySQL?

MySQL LOWER() Function The LOWER() function converts a string to lower-case. Note: The LCASE() function is equal to the LOWER() function.

How do I create a case sensitive query in MySQL?

When searching for partial strings in MySQL with LIKE you will match case-insensitive by default*. If you want to match case-sensitive, you can cast the value as binary and then do a byte-by-byte comparision vs. a character-by-character comparision. The only thing you need to add to your query is BINARY .


2 Answers

If you want to update:

UPDATE my_table SET my_column = UPPER(my_column) 
like image 146
xdazz Avatar answered Oct 08 '22 12:10

xdazz


Have a look at using UPPER

Returns the string str with all characters changed to uppercase according to the current character set mapping.

From the LINK

UCASE() is a synonym for UPPER().

Have a look at this example

SQL Fiddle DEMO

Here is an example of changing the table data

like image 21
Adriaan Stander Avatar answered Oct 08 '22 13:10

Adriaan Stander