SQL - String Operations

CONACT , SUBSTRING , LEFT , UPPER , LOWER

SELECT user_id , CONCAT( UPPER(LEFT((name),1)) , SUBSTRING(LOWER(name), 2) ) as name FROM USERS ORDER BY user_ID;


Input: 
Users table:
+---------+-------+
| user_id | name  |
+---------+-------+
| 1       | aLice |
| 2       | bOB   |
+---------+-------+
Output: 
+---------+-------+
| user_id | name  |
+---------+-------+
| 1       | Alice |
| 2       | Bob   |
+---------+-------+

留言

此網誌的熱門文章

MAP - Sort with stream

JAVA - DSF Example