SQL changes the value to upper or lower case

How to make a field in select sql expression in upper or lower case?

Example:

choose a name from Person

How to make firstname always return uppercase and also always return lowercase letters?

+58
sql uppercase lowercase case
Dec 04 '08 at 17:02
source share
5 answers
SELECT UPPER(firstname) FROM Person SELECT LOWER(firstname) FROM Person 
+91
Dec 04 '08 at 17:07
source share

LCASE or UCASE respectively.

Example:

 SELECT UCASE(MyColumn) AS Upper, LCASE(MyColumn) AS Lower FROM MyTable 
+16
Dec 04 '08 at 17:04
source share

SQL SERVER 2005:

 print upper('hello'); print lower('HELLO'); 
+5
Dec 04 '08 at 17:05
source share

You can use LOWER function and UPPER function . how

 SELECT LOWER('THIS IS TEST STRING') 

Result:

 this is test string 

and

 SELECT UPPER('this is test string') 

result:

 this is test string 
+1
Aug 14 '16 at 6:55
source share

You can do:

 SELECT lower(FIRST NAME) ABC FROM PERSON 

NOTE. ABC used if you want to change the column name

0
Jul 08 '15 at 3:05
source share



All Articles