相信自己!

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  26 随笔 :: 3 文章 :: 13 评论 :: 0 Trackbacks
select count(*) from (select tm.cust_id,
        max(tm.so_payment_date) as end_date from tc_sales_order_m tm
       group by tm.cust_id) td where td.end_date < add_months(sysdate,-3)



select count(*) from (select tm.cust_id,tm.emp_id,tm.so_id,tm.so_code,tm.so_delivery_date, tm.so_PAYMENT_DATE, max(tm.so_payment_date) as end_date
          from tc_sales_order_m tm
         group by tm.cust_id,emp_id,so_id,so_code,so_delivery_date,so_PAYMENT_DATE) td
 where td.end_date < add_months(sysdate, -3)
 
 select count(*)
  from (select tm.cust_id, max(tm.so_payment_date) as end_date
          from tc_sales_order_m tm
         where tm.owner_id = 1
         group by tm.cust_id) td,
       tc_sales_order_m tdd
 where td.end_date < add_months(sysdate, -3)
       and td.cust_id = tdd.cust_id(+)
      


posted on 2008-09-25 15:23 北极雪 阅读(250) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: