Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select t.user_id,t.time_log,substring_index(t.tstring,'#',1) am_in,substring_index(substring_index(t.tstring,'#',2),'#',-1) am_out,
- substring_index(substring_index(t.tstring,'#',-2),'#',1) pm_in,substring_index(t.tstring,'#',-1) pm_out
- from
- (select h.user_id,h.time_log,group_concat(h.stime order by h.stime separator '#') tstring
- from user_hardware h
- group by h.user_id,h.time_log
- ) t;
Add Comment
Please, Sign In to add comment