SQL UCASE() Function
- Previous Page SQL Having
- Next Page SQL lcase()
UCASE() Function
The UCASE function converts the field value to uppercase.
SQL UCASE() Syntax
SELECT UCASE(column_name) FROM table_name
SQL UCASE() Example
We have the following 'Persons' table:
Id | LastName | FirstName | Address | City |
---|---|---|---|---|
1 | Adams | John | Oxford Street | London |
2 | Bush | George | Fifth Avenue | New York |
3 | Carter | Thomas | Changan Street | Beijing |
Now, we want to select the contents of the 'LastName' and 'FirstName' columns, and then convert the 'LastName' column to uppercase.
We use the following SQL statement:
SELECT UCASE(LastName) as LastName,FirstName FROM Persons
The result set is similar to this:
LastName | FirstName |
---|---|
ADAMS | John |
BUSH | George |
CARTER | Thomas |
- Previous Page SQL Having
- Next Page SQL lcase()