transcribe_wavs/last_week.pg.sql

9 lines
483 B
MySQL
Raw Normal View History

2023-04-17 08:23:15 -04:00
SELECT
'## '||(SELECT (SELECT MAX(mdate) FROM rlarp.thirtysec)::date - ((EXTRACT(DOW FROM (SELECT MAX(mdate) FROM rlarp.thirtysec)::date) - 5 + 7) % 7) * INTERVAL '1 day' AS last_friday)
UNION ALL
SELECT '- ' ||mdate||' [[]] '||(message->>'text')
FROM
rlarp.thirtysec
WHERE
mdate >= (SELECT (SELECT MAX(mdate) FROM rlarp.thirtysec)::date - ((EXTRACT(DOW FROM (SELECT MAX(mdate) FROM rlarp.thirtysec)::date) - 5 + 7) % 7) * INTERVAL '1 day' AS last_friday)