相信自己!

            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 北極雪 閱讀(262) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 昭平县| 浮山县| 来凤县| 阜城县| 横山县| 景德镇市| 天镇县| 青岛市| 丽江市| 平罗县| 崇文区| 宁都县| 宁乡县| 沙洋县| 米林县| 深泽县| 凉城县| 诸暨市| 四平市| 喀喇| 安岳县| 乐业县| 永丰县| 吴桥县| 和田县| 沂水县| 偏关县| 璧山县| 新密市| 竹北市| 全椒县| 山丹县| 龙江县| 东源县| 策勒县| 积石山| 长宁区| 连江县| 遂川县| 曲阜市| 屏山县|