By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
8 rows affected
| m_id | m_txt | s_txt | s_date | sys_rank | new_rank |
|---|---|---|---|---|---|
| 4 | item 4 | SubItem 4-1 | 2026-03-01 | 4 | 1 |
| 4 | item 4 | SubItem 4-2 | 2020-05-01 | 4 | 1 |
| 4 | item 4 | SubItem 4-3 | 2020-03-01 | 4 | 1 |
| 2 | item 2 | SubItem 2-2 | 2025-10-11 | 2 | 2 |
| 2 | item 2 | SubItem 2-1 | 2023-07-01 | 2 | 2 |
| 2 | item 2 | SubItem 2-3 | 2020-01-01 | 2 | 2 |
| 1 | item 1 | null | null | 1 | 3 |
| 3 | item 3 | null | null | 3 | 4 |
Warning: Null value is eliminated by an aggregate or other SET operation.