开发者

Time slot count in mysql table

开发者_如何转开发

My Table Data

  ID   Start_Time  End_Time  Count(10mins slot)?  Count(20mins slot)?

1   9:00 AM      9:45 AM

2   9:10 AM     10:00 AM

I would like to find how many 10 mins.( like 9:00-9:10, 9:10-9:15 and so on..) and 20 mins. slots are available for each row

Dont know how to get this with a query, can any one help?


select id, 
       start_time,
       end_time,
       timestampdiff(MINUTE, end_time, start_time) DIV 10,
       timestampdiff(MINUTE, end_time, start_time) DIV 20
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜