关于日期比较:
select t.*,t.Rowid from sz_send_control t Where t.msg_type='MANCHESTER_I2O_P' And t.send_date> to_date('2010-12-1','yyyy-mm-dd')
汇总核销SQL
select item_no,
goods_no,
goods_name,
sum(nvl(company_recieve_amount,0) - nvl(return_amount, 0)) AS actual_apply,
declare_unit,
sum(price * (nvl(company_recieve_amount,0) - nvl(return_amount, 0))) AS total_price,
currency_type
from mc_job_form_item_goods t
where t.job_form_id in
(select id from mc_job_form t where t.declare_apply_id = ?)
group by item_no, goods_no, goods_name, declare_unit, currency_type