视图一例:
create or replace view hsy_test_v_line as select distinct --线路存在的条件 --1.必须存在于CSM_MID.POB_LINE --2.线路对应的变电站必须存在于CSM_V_STATION中,所以必须符合CSM_V_STATION的条件 --3.线路的电压等级必须存在于map_t_voltageclass中 line.lineid, line.disc, line.code, line.substationid, station.relay_station_name as substationname, line.voltageclassid, volcls.voltageclassname, line.powersupplyid, ( select distinct disc from csm_mid.pob_powersupply ps where line.powersupplyid2 = ps.powersupplyid ) powersupplyname2, decode(line.type,0,'普通线路',1,'专线') type,--线路类型 line.customerid, line.pointid from csm_mid.pob_line line left join csm_v_station station on line.substationid = station.relay_station_id left join map_t_voltageclass volcls on line.voltageclassid = volcls.voltageclassid order by line.disc;