oracle:
我們提供的服務(wù)有:網(wǎng)站設(shè)計、成都做網(wǎng)站、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認證、姚安ssl等。為千余家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的姚安網(wǎng)站制作公司
(Select to_char(a+1-Id,'YYYYMMDD') SHOW_TIME From (
SELECT rownum Id,to_date( #{endDate,jdbcType=VARCHAR} ,'YYYYMMDD') a FROM DUAL
CONNECT BY LEVEL <= to_date(#{endDate,jdbcType=VARCHAR},'YYYYMMDD') - to_date(#{startDate,jdbcType=VARCHAR},'YYYYMMDD') +1) Order By SHOW_TIME) d LEFT JOIN tableA
DB2:
--取指定區(qū)間的自然天
with date_list(SHOW_TIME) as
(select to_date(#{startDate,jdbcType=VARCHAR},'YYYYMMDD')
from test.tableA a where a.USER_ID=#{userId,jdbcType=VARCHAR}
union all
select date_list.SHOW_TIME+1 day
from test.tableA b ,date_list where b.USER_ID=#{userId,jdbcType=VARCHAR} and date_list.SHOW_TIME <= to_date( #{endDate,jdbcType=VARCHAR} ,'YYYYMMDD')),
--統(tǒng)計交易
trans_list(transDate,txnCount,txnAmt) as
(select .......)
--外連接獲取交易統(tǒng)計數(shù)據(jù)
select * from date_list d LEFT JOIN trans_list e