Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 28fd9ac

Browse files
committed
Add a question
1 parent 3144844 commit 28fd9ac

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

‎README.md‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,3 +1309,43 @@ WHERE
13091309
---
13101310

13111311
**[⬆ Back to Top](#sql-coding-challenges-for-beginners)**
1312+
1313+
## 41. Convert Date Format
1314+
1315+
Write a SQL query to convert each date in the `Days` table into a formatted string. Here is an example:
1316+
1317+
```
1318+
Days table:
1319+
+------------+
1320+
| day |
1321+
+------------+
1322+
| 2022年04月12日 |
1323+
| 2021年08月09日 |
1324+
| 2020年06月26日 |
1325+
+------------+
1326+
```
1327+
1328+
```
1329+
Result table:
1330+
+-------------------------+
1331+
| day |
1332+
+-------------------------+
1333+
| Tuesday, April 12, 2022 |
1334+
| Monday, August 9, 2021 |
1335+
| Friday, June 26, 2020 |
1336+
+-------------------------+
1337+
```
1338+
1339+
<details><summary>Solution</summary>
1340+
1341+
```sql
1342+
SELECT DATE_FORMAT(day, '%W, %M %e, %Y')
1343+
AS day
1344+
FROM Days;
1345+
```
1346+
1347+
</details>
1348+
1349+
---
1350+
1351+
**[⬆ Back to Top](#sql-coding-challenges-for-beginners)**

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /