相信自己!

            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)  編輯  收藏 所屬分類: 數據庫
          主站蜘蛛池模板: 根河市| 亚东县| 康马县| 淳化县| 大新县| 青冈县| 新化县| 沿河| 得荣县| 阳城县| 洞头县| 岳阳县| 天气| 怀安县| 兴和县| 黔南| 定西市| 二连浩特市| 三河市| 社会| 游戏| 彰化市| 晋宁县| 翁源县| 阿拉善右旗| 岢岚县| 南华县| 汝州市| 石家庄市| 中江县| 和林格尔县| 霸州市| 惠水县| 永年县| 沅陵县| 岐山县| 天峻县| 松溪县| 怀宁县| 平邑县| 武鸣县|