I got asked this: having this table:
# SELECT * FROM a ORDER BY d; t | d ---+---- O | 1 O | 2 O | 3 M | 4 M | 5 M | 6 M | 7 O | 8 O | 9 O | 10 I | 11 I | 12 I | 13 (13 ROWS)
Is it possible to add “rank" column, that will increment whenever t changed?