I've been perplexing to find a giveaway timeslots of generation 60 min
between 9:00 and 17:00 from a list carrying 3 columns (user_id,
start_time, end_time), though somehow amateurish to get it work.I've
wholly one list 'timing' where I'm storing all requisitioned slots. Assume
all entries are for a day only.Select a.id, a.end_hour AS `Free time
Start`, IFNULL(la.start_hour,a.end_hour) AS `Free Time End`,
IFNULL(TIMEDIFF(la.start_hour, a.end_hour),'00:00:00') AS `Total Free
Time`FROM timing AS a LEFT JOIN (SELECT * FROM timing LIMIT
1,18446744073709551615) AS la ON la.id = (SELECT MIN(id) FROM timing
where (id > a.id AND user_id = a.user_id) LIMIT 1)WHERE a.user_id = 2;With
this, I'm means to find all giveaway slots in between indeed used slots.
we need assistance on twin points1. How to consolidate start and finish
time of day (9:00 and 17:00, respectively). So, if initial indifferent
container starts during 10:00, 9:00-10:00 is also a giveaway slot2. How to
separate giveaway time in bound generation slots (say 1 hour)Thanks!
No comments:
Post a Comment