select decode(fb.tupr,null,'仅航路',decode(fc.aw,null,'仅终端区','航路及终端区')) 范围,pt 五字代码点,fb.tupr 终端区图及程序,fc.aw 航路 from

(

select  distinct wz pt from

(

select wz,tupr,0 from

(select f2.code_fix_point wz,min(f1.tu) tupr from

(

select sid_id id, substr(upper(decode(length(REGEXP_REPLACE(txt_rmk, '[^-]','')),1,txt_rmk,code_icao||'-'||txt_rmk)),1,7) || '   ' || upper(txt_desig) tu, '离场' tp from sid

union

select star_id id, substr(upper(decode(length(REGEXP_REPLACE(txt_rmk, '[^-]','')),1,txt_rmk,code_icao||'-'||txt_rmk)),1,7) || '   ' || upper(txt_desig) tu, '进场' tp from star

union

select iap_id id, substr(upper(decode(length(REGEXP_REPLACE(txt_rmk, '[^-]','')),1,txt_rmk,code_icao||'-'||txt_rmk)),1,7)  || '   ' || upper(txt_desig) tu, '进近' tp  from iap

) f1, procedure_leg f2

where

(

(f1.id   =f2.iap_id and f1.tp='进近') or

(f1.id=f2.sid_id    and f1.tp='离场') or

(f1.id=f2.star_id   and f1.tp='进场')

)

and f2.code_type_fix_point= 'DESIGNATED_POINT' and length(REGEXP_REPLACE(f2.code_fix_point, '[0-9]',''))=5

group by f2.code_fix_point order by wz

)

union

select wz,aw,1 from

(

select  substr(airway_point_name,instr(airway_point_name,'/')+1) wz,max(airway_identifier ) aw from AIRWAY_ORDERED_POINT

where chart_type_id =3 and

airway_point_type =11 and

instr(airway_identifier,'XX')=0 and

length(REGEXP_REPLACE(substr(airway_point_name,instr(airway_point_name,'/')+1), '[0-9]',''))=5

group by substr(airway_point_name,instr(airway_point_name,'/')+1)

)

)

)

left join

(

select wz,tupr,0 from

(

select f2.code_fix_point wz,min(f1.tu) tupr from

(

select sid_id id, substr(upper(decode(length(REGEXP_REPLACE(txt_rmk, '[^-]','')),1,txt_rmk,code_icao||'-'||txt_rmk)),1,7) || '   ' || upper(txt_desig) tu, '离场' tp from sid

union

select star_id id, substr(upper(decode(length(REGEXP_REPLACE(txt_rmk, '[^-]','')),1,txt_rmk,code_icao||'-'||txt_rmk)),1,7) || '   ' || upper(txt_desig) tu, '进场' tp from star

union

select iap_id id, substr(upper(decode(length(REGEXP_REPLACE(txt_rmk, '[^-]','')),1,txt_rmk,code_icao||'-'||txt_rmk)),1,7)  || '   ' || upper(txt_desig) tu, '进近' tp  from iap

) f1, procedure_leg f2

where

(

(f1.id   =f2.iap_id and f1.tp='进近') or

(f1.id=f2.sid_id    and f1.tp='离场') or

(f1.id=f2.star_id   and f1.tp='进场')

)

and f2.code_type_fix_point= 'DESIGNATED_POINT' and length(REGEXP_REPLACE(f2.code_fix_point, '[0-9]',''))=5

group by f2.code_fix_point order by wz

)

) fb

on pt=fb.wz

left join

(

select wz,aw,1 from

(

select  substr(airway_point_name,instr(airway_point_name,'/')+1) wz,max(airway_identifier ) aw from AIRWAY_ORDERED_POINT

where chart_type_id =3 and

airway_point_type =11 and

instr(airway_identifier,'XX')=0 and

length(REGEXP_REPLACE(substr(airway_point_name,instr(airway_point_name,'/')+1), '[0-9]',''))=5

group by substr(airway_point_name,instr(airway_point_name,'/')+1)

)

)fc

on pt=fc.wz

order by decode(fb.tupr,null,2,decode(fc.aw,null,3,1))

最新文章

  1. 回归树|GBDT|Gradient Boosting|Gradient Boosting Classifier
  2. sql join用法学习
  3. php函数的传值如果需要引用传递注意的细节
  4. Java连接池详解
  5. HDU 2098 分拆素数和
  6. (转)Maven实战(二)构建简单Maven项目
  7. mysql Fatal error encountered during command execution
  8. BZOJ 1050: [HAOI2006]旅行comf (并查集 或 单调队列)
  9. JSP自定义标签就是如此简单
  10. [BZOJ1657] [Usaco2006 Mar] Mooo 奶牛的歌声 (单调栈)
  11. 移动端,input、textarea滚动至可视区域
  12. 【Spark篇】---Spark中广播变量和累加器
  13. web前端之Javascript---function函数
  14. Cannot make a static reference to the non-static
  15. nginx——Nginx 防爬虫优化
  16. 【JVM.11】Java内存模型与线程
  17. sublime text 3-right click context menu
  18. 使用vuex保存singer每个歌星的基本信息
  19. oracle客户端plsql安装
  20. [bash] 显示配色

热门文章

  1. Excel 如何复制粘贴一整行
  2. javascript是一种面向对象语言吗?如果是,您在javascript中是如何实现继承的呢
  3. 快速的熟悉一个angular的项目从run看起
  4. 查看后台PHP进程(非PHP-FPM)
  5. Javascript-我对作用链、闭包、原型及原型链的理解
  6. Hbase 使用方法
  7. Windows 10 Certified with Oracle E-Business Suite
  8. AI探索(四)NumPy库的使用
  9. ionic2——apk签名
  10. (转)Android 弹软键盘时listview的变化控制