tas/database/migrations/202208201623.sql

10 lines
179 B
MySQL
Raw Normal View History

2022-08-20 16:45:45 +03:00
CREATE VIEW finished_tasks
AS
SELECT
t.*,
row_number() OVER (ORDER BY t.finished_at DESC) AS idx
FROM tasks AS t
WHERE t.finished_at IS NOT NULL
ORDER BY t.finished_at DESC
;