相信自己!

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            26 隨筆 :: 3 文章 :: 13 評論 :: 0 Trackbacks
          select t5.friendid,
                 t6.friend_name,
                 t5.contractnumber,
                 t5.total_value,
                 t5.start_date,
                 t5.end_date,
                 t6.emp_name as salename,
                 t6.dept_name,
                 t6.friend_phone
            from (select t1.cust_id          as friendId,
                         t1.so_code          as contractnumber,
                         t1.so_amount        as TOTAL_VALUE,
                         t1.so_delivery_date as START_DATE,
                         t1.so_PAYMENT_DATE  as END_DATE
                    from tc_sales_order_m t1
                   where t1.so_payment_date + 7 > sysdate
                     and t1.so_payment_date < sysdate) t5,
                 (select t2.emp_id, t4.emp_name,t3.dept_name,t7.friend_phone, t3.biz_dept_id, t2.friend_id, t7.friend_name
                    from rel_friend_emp t2,
                         tc_department  t3,
                         tc_employee    t4,
                         tc_friend      t7
                   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 t7.owner_id = 1
                     and t2.friend_id = t7.friend_id
                     and t3.biz_dept_id = '110') t6
           where t5.friendid = t6.friend_id(+);
          posted on 2008-09-23 10:08 北極雪 閱讀(164) 評論(0)  編輯  收藏 所屬分類: 數據庫
          主站蜘蛛池模板: 安远县| 集安市| 建昌县| 乌拉特前旗| 麟游县| 纳雍县| 仲巴县| 改则县| 花莲县| 玉龙| 陆川县| 临泉县| 汨罗市| 儋州市| 小金县| 常宁市| 通河县| 兰溪市| 化隆| 保山市| 商水县| 全南县| 新疆| 抚顺市| 平安县| 即墨市| 冀州市| 潍坊市| 香河县| 扶沟县| 平安县| 灌南县| 临澧县| 绥德县| 石林| 固安县| 崇礼县| 台北市| 肇源县| 达拉特旗| 郸城县|