for two different timestamps, let\'s say timestamp(\'2015-02-01\') and timestamp (\'2015-02-12\'), I want a column with all the dates in between. Like this (12 Rows) 2015-
@Pentium10 answer is the right and classic way of filling ranges. Just for fun, I wanted to also give an alternative which doesn't rely on any additional table. This solution goes like that:
Here is the whole query put together:
select date(date_add(day, i, "DAY")) day
from (select '2015-01-01' day) a
cross join
(select
position(
split(
rpad('', datediff('2015-01-15','2015-01-01')*2, 'a,'))) i
from (select NULL)) b;