查询每个月的数据从月头到下个月头
2017-02-05 本文已影响0人
a_foo
select to_char(t.create_date,'yyyy-mm-dd hh24:mi:ss')time from fs_s01_act_lhl_record t where t.create_date >=to_date(to_char(add_months(trunc(sysdate),?),'yyyy/mm')||'/01','yyyy/mm/dd')"+
" and t.create_date< to_date(to_char(add_months(trunc(sysdate),?),'yyyy/mm')||'/01','yyyy/mm/dd')"+
"and t.accounts=? and t.activity_no=? ORDER BY T.CREATE_DATE ASC "