oracle中查询一月的时间补0的问题
sql语句
select NVL(B.weight, 0),A.time from
(SELECT TO_CHAR(TO_DATE(开始时间, 'yyyy-MM-dd') + ROWNUM - 1, 'yyyy-MM-dd') AS time
FROM DUAL
CONNECT BY ROWNUM <= TRUNC(TO_DATE(结束时间, 'yyyy-MM-dd') - TO_DATE(开始时间, 'yyyy-MM-dd')) + 1) A
left join (
自己的业务
) B on A.time = B.time order by A.time desc