日期:2014-05-17 浏览次数:21112 次
select * from (
select pt_user_id,
pt_user_name,
contract_id,
min(anr) anr,
pay_style,
period_num,
(select qh_res_id from bs.etb_v_order_card_term b where b.sale_contract_id = a.contract_id and b.pt_user_id = a.pt_user_id and rownum<=1) qh_res_id,
(select delivery_flag from bs.etb_v_order_card_term b where b.sale_contract_id = a.contract_id and b.pt_user_id = a.pt_user_id and rownum<=1) cer_self_take,
b_typename,
total_qty,
make_date,
valid_date,
(select contract_intent_status from bs.etb_v_order_card_term b where b.sale_contract_id = a.contract_id and b.pt_user_id = a.pt_user_id and rownum<=1) ht_status,
(select delivery_e_name from pnf_contract_delivery c where c.type_id = '1' and c.contract_id is not null and c.customer_id=a.customer_id and c.contract_id = a.contract_id and rownum<=1) qr_man,
a.contract_status co_status,
customer_id,
cust_name,
b_typeid,
(select sales_contract_id from bs.etb_v_order_card_term b where b.sale_contract_id = a.contract_id and b.pt_user_id = a.pt_user_id and rownum<=1) sales_contract_id,
(select sh_name from bs.etb_v_order_card_term b where b.sale_contract_id = a.contract_id and b.pt_user_id = a.pt_user_id and rownum<=1) sh_name,
(select end_trans_dw from bs.etb_v_order_card_term b where b.sale_contract_id = a.contract_id and b.pt_user_id = a.pt_user_id and rownum<=1) end_trans_dw,
(select end_trans_dw_name from bs.etb_v_order_card_term b where b.sale_contract_id = a.contract_id and b.pt_user_id = a.pt_user_id and rownum<=1) end_trans_dw_name