oracle 时间的比较

1.时间需用 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

 sdf.format(new Date())格式化后传进去


2.select to_char(porder_completed,'yyyy-mm-dd') as name,count(porder_id) as visits,sum(PORDER_ACCOUNT) as views

FROM( select * from sell_porder_form where porder_state='completed')

where to_char(porder_completed,'yyyy-mm-dd')>='2013-06-02 ' and  to_char(porder_completed,'yyyy-mm-dd')<='2013-06-08' and Porder_origin = 'retail' group by to_char(porder_completed,'yyyy-mm-dd')


你可能感兴趣的:(oracle,时间的比较,completed)