clear markdown feedback
clear markdown feedback
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 3799065 fiddles created (41793 in the last week).

WITH rentabilidade_fundos AS ( SELECT '2020-04-01' DATA, -0.25 fundo_conservador, -0.35 fundo_moderado, -0.45 fundo_arrojado ), dias AS ( SELECT DATE_ADD('2020-04-01', INTERVAL rnk day) dia FROM (SELECT row_number() over() -1 rnk FROM information_schema.columns limit 31) gerado) SELECT dias.dia, r.fundo_conservador, r.fundo_moderado, r.fundo_arrojado from dias LEFT OUTER JOIN rentabilidade_fundos r ON r.data = dias.dia where dias.dia BETWEEN '2020-04-01' AND '2020-04-31' order by dias.dia
dia fundo_conservador fundo_moderado fundo_arrojado
2020-04-01 -0.25 -0.35 -0.45
2020-04-02
2020-04-03
2020-04-04
2020-04-05
2020-04-06
2020-04-07
2020-04-08
2020-04-09
2020-04-10
2020-04-11
2020-04-12
2020-04-13
2020-04-14
2020-04-15
2020-04-16
2020-04-17
2020-04-18
2020-04-19
2020-04-20
2020-04-21
2020-04-22
2020-04-23
2020-04-24
2020-04-25
2020-04-26
2020-04-27
2020-04-28
2020-04-29
2020-04-30
 hidden batch(es)