相信自己!

  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 北极雪 阅读(154) 评论(0)  编辑  收藏 所属分类: 数据库

只有注册用户登录后才能发表评论。


网站导航: