mirror of https://github.com/doocs/leetcode.git
|
…
|
||
|---|---|---|
| .. | ||
| README.md | ||
| README_EN.md | ||
| Solution.sql | ||
README_EN.md
| comments | difficulty | edit_url | tags | |
|---|---|---|---|---|
| true | Easy | https://github.com/doocs/leetcode/edit/main/solution/1800-1899/1853.Convert%20Date%20Format/README_EN.md |
|
1853. Convert Date Format 🔒
Description
Table: Days
+-------------+------+ | Column Name | Type | +-------------+------+ | day | date | +-------------+------+ day is the column with unique values for this table.
Write a solution to convert each date in Days into a string formatted as "day_name, month_name day, year".
Return the result table in any order.
The result format is in the following example.
Example 1:
Input: Days table: +------------+ | day | +------------+ | 2022-04-12 | | 2021-08-09 | | 2020-06-26 | +------------+ Output: +-------------------------+ | day | +-------------------------+ | Tuesday, April 12, 2022 | | Monday, August 9, 2021 | | Friday, June 26, 2020 | +-------------------------+ Explanation: Please note that the output is case-sensitive.
Solutions
Solution 1
MySQL
# Write your MySQL query statement below
SELECT DATE_FORMAT(day, '%W, %M %e, %Y') AS day FROM Days;