<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    相信自己!

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
      26 隨筆 :: 3 文章 :: 13 評論 :: 0 Trackbacks
    select t5.emp_name as sale_name,
           t9.emp_name as cs_name,
           t5.dept_name,
           t5.friend_id,
           t5.friend_name,
           t5.contract_number,
           t5.total_value,
           t5.so_id,
           t5.start_date,
           t5.end_date,
           t5.friend_phone,
           t5.num /*count(*)*/
      from (select t1.cust_id as friend_Id,
                   t1.so_id,
                   t1.emp_id,
                   t2.emp_name,
                   tf.friend_name,
                   t3.dept_name,
                   tf.friend_phone,
                   t1.so_code as contract_number,
                   t1.so_amount as TOTAL_VALUE,
                   t1.so_delivery_date as START_DATE,
                   t1.so_PAYMENT_DATE as END_DATE,
                   t4.num
              from tc_sales_order_m t1,
                   tc_employee t2,
                   tc_department t3,
                   tc_friend tf,
                   (select tss.cust_id, tss.num
                      from (
                            select cust_id, count(*) as num
                              from tc_sales_order_m ts
                             where ts.owner_id = 1
                               and ts.create_time <
                                   to_date('2008-09-27', 'YYYY-mm-dd')
                             group by cust_id) tss
                     where tss.num = 1
                     and tss.cust_id in
                           (select tm2.cust_id
                              from tc_sales_order_m tm2
                             where tm2.owner_id = 1
                               and tm2.create_time <=
                                   to_date('2001-01-05', 'YYYY-mm-dd')
                               and tm2.create_time >=
                                   to_date('2001-01-04', 'YYYY-mm-dd'))) t4
             where t1.owner_id = 1
               and t2.owner_id = 1
               and t3.owner_id = 1
               and tf.owner_id = 1
               and t1.create_time <= to_date('2001-01-05', 'YYYY-mm-dd')
               and t1.create_time >= to_date('2001-01-04', 'YYYY-mm-dd')
               and tf.friend_id = t1.cust_id
               and t1.emp_id = t2.emp_id
               and t2.dept_id = t3.dept_id
               and t1.cust_id(+) = t4.cust_id
               and t3.biz_dept_id = '110'
               and t1.cust_id = t4.cust_id
               and t3.DEPT_CODE not like '0112%'
               and t3.DEPT_CODE not like '0113%') t5,
           (select t4.emp_name, t2.friend_id
              from rel_friend_emp t2, tc_department t3, tc_employee t4
             where t2.emp_id = t4.emp_id
               and t3.dept_id = t4.dept_id
               and t2.owner_id = 1
               and t3.owner_id = 1
               and t4.owner_id = 1
               and t2.is_self = 1
               and t3.biz_dept_id = '130') t9
     where t5.friend_id = t9.friend_id(+)
    posted on 2008-09-27 14:24 北極雪 閱讀(303) 評論(0)  編輯  收藏 所屬分類: 數據庫
    主站蜘蛛池模板: 亚洲精品第五页中文字幕| 免费福利在线观看| 亚洲av无码偷拍在线观看| 中文字幕版免费电影网站| 久久精品免费全国观看国产| 亚洲乱码中文字幕手机在线| 亚洲伊人色一综合网| 两性色午夜视频免费网| 日韩一卡2卡3卡4卡新区亚洲| 亚洲人AV在线无码影院观看| 免费视频一区二区| 亚洲国产小视频精品久久久三级 | 曰批全过程免费视频观看免费软件| 日韩一级视频免费观看| 亚洲精品国精品久久99热一| 亚洲爆乳AAA无码专区| 亚洲一级毛片免费在线观看| 亚洲人色婷婷成人网站在线观看| 亚洲av日韩av永久在线观看| 免费人成视网站在线观看不卡| 亚洲日本va在线观看| 亚洲精品免费视频| 久久精品国产亚洲av麻| 精品一区二区三区免费视频| 亚洲国产精品第一区二区三区| 亚洲日韩一区二区一无码| 国产免费观看网站| 国产天堂亚洲精品| 成人免费午夜视频| 亚洲色大成网站WWW国产| 国产在线a免费观看| 亚洲a∨无码精品色午夜| 亚洲宅男天堂在线观看无病毒| 无码AV片在线观看免费| 亚洲最大无码中文字幕| 亚洲第一成人影院| 美丽的姑娘免费观看在线播放| 久久水蜜桃亚洲av无码精品麻豆| 9420免费高清在线视频| 亚洲精品在线免费观看视频| 在线观看免费亚洲|