Skip to content

Commit ba0f840

Browse files
authored
Create 1667.Fix-Names-in-a-Table.sql
1 parent 649fd63 commit ba0f840

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Easy/1667.Fix-Names-in-a-Table.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--MySQL
2+
SELECT
3+
user_id,
4+
CONCAT(UPPER(LEFT(name, 1)),
5+
LOWER(SUBSTR(name, 2, LENGTH(name)))) AS name
6+
FROM Users
7+
ORDER BY user_id;
8+
9+
--MS SQL Server
10+
SELECT
11+
user_id,
12+
CONCAT(UPPER(LEFT(name, 1)),
13+
LOWER(SUBSTRING(name, 2, LEN(name)))) AS name
14+
FROM Users
15+
ORDER BY user_id;
16+

0 commit comments

Comments
 (0)