SQL UCASE() | UPPER() Function
The SQL UCASE() | UPPER() is a function, and converts the value of a column to uppercase.
The SQL UCASE() | UPPER() function is supports only character based column and it will not work on a numeric field.
It can be used in any valid SQL SELECT statement as well in SQL where clause.
Related Links
Sql ucase function using sql ucase function, sql server uppercase, sql server uppercase function.
SQL UCASE() | UPPER() Syntax
For MS Access / ORACLE / MY SQL
// Convert a input string or text expression to uppercase
SELECT UCASE(string or text);
// Convert a specific table column value to uppercase
SELECT UCASE(column_name1) FROM table_name;
For SQL SERVER / MYSQL
// Convert a input string or text expression to uppercase
SELECT UPPER(string or text);
// Convert a specific table column value to uppercase
SELECT UPPER(column_name1) FROM table_name;
SQL UCASE() | UPPER() Example - Using Expression Or Formula
The following SQL SELECT statement will convert of a given input string to uppercase:
For MS Access / ORACLE / MY SQL
SELECT UCASE('WWW.SimmanChith.COM');
For SQL SERVER / MYSQL
SELECT UPPER('WWW.SimmanChith.COM');
The result of above query is:
Expr |
---|
WWW.SIMMANCHITH.COM |
SQL UCASE() | UPPER() Function More Example
Input Value | Result |
---|---|
UCASE('Sql DataBase Tutorial') | SQL DATABASE TUTORIAL |
UCASE('SQL DB 5.0') | SQL DB 5.0 |
Sample Database Table - Employee
ID | EmpName | Designation | Dept | JoinYear | Salary |
---|---|---|---|---|---|
1 | Devi Mai | SQL Security | SQL Server | 2013 | 21320 |
2 | Vidyavathi | Database Developer | MS Access | 2014 | 12290.1 |
3 | Sakunthala | Project Lead | Java | 2015 | 16280 |
4 | Pandurengan | Project Manager | ASP.Net | 2014 | 15650.8 |
SQL UCASE() | UPPER() Example
The following SQL statement selects the "ID" and "Dept" fields from the "Employee" table, and converts the "Dept" column to uppercase:
For MS Access / ORACLE / MY SQL
SELECT ID,
UCASE(Dept) As 'Dept Column In Upper Case'
FROM Employee;
For SQL SERVER / MYSQL
SELECT ID,
UPPER(Dept) As 'Dept Column In Upper Case'
FROM Employee;
The result of above query is:
ID | Dept Column In Upper Case |
---|---|
1 | SQL SERVER |
2 | MS ACCESS |
3 | JAVA |
4 | ASP.NET |
Related Links
Sql upper function using uppercase first letter, convert to uppercase, case sensitive, case insensitive, compare case sensitive.