I have a MySQL table (A) and I would like the end result to look like (B). Does anyone know how I can accomplish this task?? I’m guessing a loop/stored procedure, but I’m not sure and I’m fairly new to loops and stored procedures.
(A)
Name str_date end_date
Lorenzo 2010-10-09 2010-10-11
Karen 2010-09-10 2010-09-10
Mike 2010-06-01 2010-06-03
(B)
Name Date
Lorenzo 2010-10-09
Lorenzo 2010-10-10
Lorenzo 2010-10-11
Karen 2010-09-10
Mike 2010-06-01
Mike 2010-06-02
Mike 2010-06-03
dont even try to do this in mysql, use your server side programming language to format data.
and if you really, really, really want to:
create a table with all dates needed (i.e. since 1970-01-01 to 2030-01-01) and do something like (untested):
but still its server side task, not db.