select * from cost_equip_category_typ
要求结果按 Gas Turbine, Generator, Steam
排序 (2,1,4)
select distinct pg.part_grp_id, pg.part_grp_name,pg.equip_category_id
from cost_part_grp pg,cost_part_kit pk,
cost_part_event pe
where pe.mdl_ver_id in (select s.mdl_ver_id from cost_fleet_model s where s.fleet_id=1002)
and pe.part_kit_id = pk.part_kit_id
and pk.part_grp_id = pg.part_grp_id order by decode(pg.equip_category_id ,2,1,1,2,4,3,4)
或者
select distinct pg.part_grp_id, pg.part_grp_name,pg.equip_category_id
from cost_part_grp pg,cost_part_kit pk,
cost_part_event pe
where pe.mdl_ver_id in (select s.mdl_ver_id from cost_fleet_model s where s.fleet_id=1002)
and pe.part_kit_id = pk.part_kit_id
and pk.part_grp_id = pg.part_grp_id order by case pg.equip_category_id when 2 then 1 when 1 then 2 when 4 then 3 else 4 end