10 lines
179 B
MySQL
10 lines
179 B
MySQL
|
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
|
||
|
;
|