Oracle
(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:
--Take the natural days of the specified interval
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 ')),
--Statistical transactions
Trans_list (Transdate,txncount,txnamt) as
(SELECT ...)
--External connection Get transaction statistics
SELECT * from Date_list D left JOIN trans_list E
DB2 the natural days of the specified interval