Add a query for finding most recent appearance by caster
This commit is contained in:
parent
96038bef34
commit
745daf3da0
|
@ -214,6 +214,16 @@ SELECT DATE(jst) AS dt,
|
|||
HAVING c > 1
|
||||
ORDER BY dt DESC;
|
||||
|
||||
-- Caster's Last Appearance
|
||||
SELECT c.n AS name,
|
||||
MAX(s.jst) AS last_appearance,
|
||||
JULIANDAY(DATETIME('now', '+09:00')) - JULIANDAY(MAX(s.jst)) AS days_since
|
||||
FROM schedule s
|
||||
JOIN caster c ON c.id = s.caster_id
|
||||
WHERE s.jst < REPLACE(DATETIME('now', '+09:00'), ' ', 'T')
|
||||
GROUP BY c.n
|
||||
ORDER BY last_appearance DESC;
|
||||
|
||||
-- MANUAL FIXES
|
||||
|
||||
-- copy matsu's cancelled coffee time to cancellation table
|
||||
|
|
Loading…
Reference in New Issue