ROW_NUMBER() function to assign a row number to each log_id in ascending order.log_id and the row number to identify continuous ranges.log_id within each group to find the start and end of each range.start_id to get the ranges in ascending order.
erDiagram
Logs {
int log_id PK
}