How can I group by transactions like this
'0:01AM -1:00 AM' and it will interpret as 01
'1:01AM-2:00 AM' as 02
'10:01 PM-11:00 PM' as 23 and so on..


because I need to create a txtfile with this kind of format.

Name:  1.jpg
Views: 394
Size:  40.8 KB

I want to know also your thoughts on the above image how to generate txtfile with that output from sql.

Thanks.