Skip to content
Advertisement

Overlap the intervals using mysql

how to merge the overlapping intervals and get the below result in mysql(8.X)?

Below are the commands that can be used in mysql to create the table =>

can you please share any elegant solution without inserting into intermediate table in mysql(8.X)?

Advertisement

Answer

Please check:

fiddle (applicable even in 5.6).

I have not yet been able to find the source data that produces the wrong result.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement