LeetCode 1667. Fix Names in a Table
考点 | 难度 |
---|---|
Database | Easy |
题目
Write an SQL query to fix the names so that only the first character is uppercase and the rest are lowercase.
Return the result table ordered by user_id
.
The query result format is in the following example.
答案
SELECT user_id, concat(upper(LEFT(name, 1)), lower(RIGHT(name, length(name)-1))) as name
FROM users
ORDER BY user_id;