相信自己!

            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 北極雪 閱讀(167) 評論(0)  編輯  收藏 所屬分類: 數據庫
          主站蜘蛛池模板: 兴化市| 襄垣县| 宁波市| 游戏| 朝阳区| 桃园县| 托克逊县| 祁阳县| 沅江市| 关岭| 建德市| 炎陵县| 武汉市| 崇州市| 临桂县| 台南县| 乌审旗| 平谷区| 宜兰市| 高州市| 苏尼特左旗| 永嘉县| 迭部县| 阳新县| 馆陶县| 海南省| 嫩江县| 寿宁县| 井研县| 建昌县| 柘城县| 高碑店市| 彰化县| 安义县| 东莞市| 基隆市| 丰城市| 镇平县| 望谟县| 阜康市| 古丈县|