Bạn không cần CASE
tuyên bố:
SELECT id, date, last_value(status) OVER (PARTITION BY id ORDER BY date) AS stat
FROM table;
Bạn không cần CASE
tuyên bố:
SELECT id, date, last_value(status) OVER (PARTITION BY id ORDER BY date) AS stat
FROM table;