Home
Random
Log in
Settings
About Rosetta Code
Disclaimers
Rosetta Code
Search
Day of the week: Difference between revisions
Page
Discussion
← Older edit
Newer edit →
Day of the week
(view source)
Revision as of 08:58, 15 February 2023
384 bytes removed
,
1 year ago
→{{header|PostgreSQL}}
Revision as of 08:57, 15 February 2023
(
view source
)
Agonzalez
(
talk
|
contribs
)
(
→{{header|SQL}}
)
← Older edit
Revision as of 08:58, 15 February 2023
(
view source
)
Agonzalez
(
talk
|
contribs
)
(
→{{header|PostgreSQL}}
)
Newer edit →
Line 5,368:
FROM cte
where strftime('%w', dt) = '0';
</syntaxhighlight>
=={{header|PostgreSQL}}==
<syntaxhighlight lang="sql"> WITH RECURSIVE cte AS (
SELECT date '2008-12-25' + interval '12 month' * 0 as dt, 1 AS level
UNION ALL
SELECT date '2008-12-25' + interval '12 month' * level as dt, c.level + 1
FROM cte c
WHERE c.level <= 2121 - 2008 + 1
)
SELECT dt
FROM cte
where to_char(dt, 'Dy') = 'Sun';
</syntaxhighlight>
Agonzalez
11
edits