相信自己!

            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)  編輯  收藏

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


          網站導航:
           
          主站蜘蛛池模板: 博爱县| 息烽县| 桃园市| 荔浦县| 衡阳县| 苏尼特右旗| 安义县| 玛沁县| 塘沽区| 灵寿县| 游戏| 井陉县| 潞城市| 集安市| 绥芬河市| 南川市| 越西县| 全南县| 巴彦县| 霍州市| 清原| 南部县| 兴城市| 曲水县| 沅江市| 涿鹿县| 双柏县| 敦化市| 凤庆县| 吉水县| 阆中市| 霍城县| 虹口区| 东安县| 肃南| 延边| 广河县| 麻阳| 泾川县| 肥东县| 鄂托克前旗|