相信自己!

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

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


          網站導航:
           
          主站蜘蛛池模板: 泌阳县| 紫阳县| 克山县| 兴国县| 普安县| 留坝县| 磐石市| 齐齐哈尔市| 清新县| 积石山| 康马县| 措美县| 郁南县| 南京市| 贵南县| 娄底市| 佛教| 饶平县| 靖州| 永清县| 大邑县| 咸阳市| 开鲁县| 木兰县| 玉林市| 嵩明县| 马龙县| 买车| 曲周县| 苍南县| 嘉峪关市| 清苑县| 巴林右旗| 儋州市| 临澧县| 南康市| 启东市| 志丹县| 孝昌县| 静安区| 彭阳县|