-
1667. Fix Names in a Table oracleLeetCode_Study_Plan/SQL 2022. 9. 27. 12:34
https://leetcode.com/problems/fix-names-in-a-table/
select user_id, initcap(name) as name from users order by user_id;
SQL 문법 참고 : https://1day1code.tistory.com/entry/SQL-%EB%AC%B8%EC%9E%90-%ED%95%A8%EC%88%98-LOWER-UPPER-INITCAP
MySQL에는 initcap이란 문법이 없길래 어떻게 하나 찾아봤다.
select user_id, concat(upper(left(name, 1)), lower(right(name, length(name) - 1))) as name from Users group by 1 order by 1;
출처 :
https://medium.com/jen-li-chen-in-data-science/leetcode-sql-9aa7dab0f56b
'LeetCode_Study_Plan > SQL' 카테고리의 다른 글
1527. Patients With a Condition mysql (0) 2022.09.27 1484. Group Sold Products By The Date mysql (0) 2022.09.27 196. Delete Duplicate Emails mysql (0) 2022.09.26 627. Swap Salary mysql (0) 2022.09.26 1873. Calculate Special Bonus mysql (0) 2022.09.26