문제
입력 코드
SELECT user_id,
CONCAT(UPPER(LEFT(name, 1)), LCASE(SUBSTRING(name, 2))) AS name
FROM Users
ORDER BY user_id
SELECT user_id,
CONCAT(UPPER(SUBSTRING(name, 1, 1)), LOWER(SUBSTRING(name, 2))) AS name
FROM Users
ORDER BY user_id
SELECT user_id,
CONCAT(UPPER(SUBSTR(name, 1, 1)), LOWER(RIGHT(name, LENGTH(name)-1))) AS name
FROM Users
ORDER BY user_id
코드 설명
#SELECT #CONCAT #UPPER #LOWER #LEFT #RIGHT #LCASE #SUBSTRING #SUBSTR #LENGTH #ORDER BY
문제 출처
'SQL' 카테고리의 다른 글
#120. [LeetCode / MySQL] 196. Delete Duplicate Emails (0) | 2024.06.21 |
---|---|
#119. [LeetCode / MySQL] 1527. Patients With a Condition (0) | 2024.06.21 |
#117. [LeetCode / MySQL] 185. Department Top Three Salaries (0) | 2024.06.20 |
#116. [LeetCode / MySQL] 585. Investments in 2016 (0) | 2024.06.19 |
#115. [LeetCode / MySQL] 602. Friend Requests II: Who Has the Most Friends (0) | 2024.06.19 |