It seems this is what you're looking for:
SELECT
rank() OVER (PARTITION BY client_addr ORDER BY start) AS RK,
client_addr,
start
FROM my_table
ORDER BY RK, inet(client_addr)
Output:
| RK | CLIENT_ADDR | START |
|----|-------------|---------------------------|
| 1 | 1.2.3.4 | January, 01 1970 12:54:06 |
| 1 | 5.6.7.8 | January, 01 1970 11:00:00 |
| 1 | 9.9.9.9 | January, 01 1970 14:00:00 |
| 2 | 1.2.3.4 | January, 01 1970 12:55:00 |
| 2 | 5.6.7.8 | January, 01 1970 12:54:06 |
| 3 | 5.6.7.8 | January, 01 1970 13:00:00 |
Note you'll have to user the inet
function if you want the IP address 10.12.13.14
to be sorted after the 9.9.9.9
instead of after 1.2.3.4
(see the fiddle below).
Fiddle here.