相信自己!

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

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


          網站導航:
           
          主站蜘蛛池模板: 江川县| 平顶山市| 介休市| 象山县| 银川市| 敖汉旗| 霍邱县| 大足县| 宁明县| 乐昌市| 玉环县| 桐城市| 二手房| 昭苏县| 阳山县| 恩平市| 南开区| 东乡族自治县| 航空| 桂平市| 彩票| 汉寿县| 和静县| 宁波市| 黎平县| 通州市| 昌邑市| 惠水县| 额敏县| 磴口县| 龙江县| 靖安县| 奈曼旗| 灵寿县| 南和县| 邯郸县| 桓仁| 德庆县| 南通市| 呼和浩特市| 仙桃市|