CREATE OR REPLACE VIEW CONTRACT AS
select t.*, a.trade_id 
from
(selectcontract.*,compact.agent_type_id,compact.lastreceivedate,compact.v_cont_banben,compact.othercost,compact.averagediscount,compact.adcontent,compact.walla_id ,compact.special_list_id from contract  @nfadv,compact @nfadv where compact.compact_id = contract.compact_id) t,
(select tc.contract_no,tc.trade_id from (select contract_no,trade_id,row_number() over (partition by contract_no order by trade_id) as row_number from consch_list@nfadv) tc where tc.row_number = 1)b
where  t.contract_no(+) = b.contract_no
查询语句:
select trade_id from contract 
然后报错 见下图: