Anyone could help me in a query that **merge a interval of datas?
ex: Common select:
SELECT id, date_start, date_end FROM evento ORDER BY date_start
I GOT THIS:
FROM THIS:
but a want a query that return this:
01 - 2013-10-11 08:00:00 2013-10-11 15:00:00
02 - 2013-10-11 16:00:00 2013-10-11 19:00:00
Thanks a lot!
You may also try this query (once more solutions beside those given by
PM 77-1
in the comment above) :Demo ---> http://www.sqlfiddle.com/#!12/bdf7e/9
however for huge table the performance of this query could be horribly slow, and some procedural approach might perform better.