select f1.pro_id,f1.pro_type, f1.code_fix_point, f1.code_type_fix_point, f1.code_fir,f2.code_icao,
nvl
(
    (select f3.significant_point_id from airway_point f3
     where f3.code_id=f1.code_fix_point
     and f3.code_icao=f2.code_icao
     and f3.origin_type=f1.code_type_fix_point
     and f3.isvalid=1
    ),
    (select f4.significant_point_id  from airway_point f4
       where f4.code_id=f1.code_fix_point
       and f4.code_fir_jep=f1.code_fir
       and f4.origin_type=f1.code_type_fix_point
       and f4.isvalid=1
       and not exists --如果没有此notexists段,会提示单条查询返回多个结果。原以为前面的nvl会排除掉nvl中二者重复的记录,但实际情况说明sql执行顺序可能不是按nvl参数顺序执行,可能是倒序执行
      ( 
       select f5.significant_point_id from airway_point f5
       where f5.code_id=f1.code_fix_point
       and f5.code_icao=f2.code_icao
       and f5.origin_type=f1.code_type_fix_point
       and f5.isvalid=1
      )
    )    
)pnt
from procedure_leg f1, procedure f2
where f1.code_fix_point is not null
and f1.pro_id=f2.PRO_ID and f1.pro_type=f2.PRO_TYPE

查询cad库中,所有程序leg引用的点的id,需要预先处理点表和程序表的更多相关文章

  1. 2015.7.24 CAD库中列举五字代码点所属航路及终端区图,左连接的累加

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

  2. oracle 查询当前库中所有表以及某表字段信息

    select utc.COLUMN_ID,utc.TABLE_NAME,utc.COLUMN_NAME,utc.DATA_TYPE||utc.DATA_LENGTH,utc.DATA_DEFAULT, ...

  3. CAD库中统计PBN运行航路条数和总距离

    select 'PBN运行航路' 类型, fb.b 总条数, fa.a 总距离 from                (                select sum(s)  a  from ...

  4. CAD库中列举所有航路点

    select distinct f1.airway_point_name,f1.latitude,f1.longitude,upper(f1.airway_point_type_name)type,f ...

  5. oracle中查询某个库中所有的表以及所占的表空间大小

    1. 查某一用户下的表select SEGMENT_NAME,TABLESPACE_NAME,sum(BYTES/1024/1024)||'M' from USER_extents where SEG ...

  6. 批量查询hive库中所有表的count

    一.准备文件 mkdir /query_hive_table_count touch query_db_name_table touch query_table_result.txt 二.编辑文件 2 ...

  7. MySQL中查询所有数据库占用磁盘空间大小和单个库中所有表的大小的sql语句

    查询所有数据库占用磁盘空间大小的SQL语句: ,),' MB') as data_size, concat(,),'MB') as index_size from information_schema ...

  8. 在Team Foundation Server (TFS)的代码库或配置库中查找文件或代码

    [update 2017.2.11] 最新版本的TFS 2017已经增加了代码搜索功能,可以参考这个链接 https://blogs.msdn.microsoft.com/visualstudioal ...

  9. sql 查询目标数据库中所有的表以其关键信息

    1.查询目标库中的所有表 SELECT obj.name tablename, ---表名 schem.name schemname, ---表所属的方案 idx.rows, ---一共有几行数组 C ...

随机推荐

  1. 牛客练习赛13D

    定义一个数字为幸运数字当且仅当它的所有数位都是4或者7.比如说,47.744.4都是幸运数字而5.17.467都不是.现在想知道在1...n的第k小的排列(permutation,https://en ...

  2. hdu 5974 A Simple Math Problem

    A Simple Math Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Ot ...

  3. 【spark】常用转换操作:keys 、values和mapValues

    1.keys 功能: 返回所有键值对的key 示例 val list = List("hadoop","spark","hive",&quo ...

  4. MS SQL GUID

    (转自:http://blog.csdn.net/maonongwu/article/details/6327093) GUID介绍 GUID(Global unique identifier)全局唯 ...

  5. python基础之面向对象(二)

    面向对象对程序设计OOD 找对象---->找类(归纳对象相同的特征与技能,还有没和对象独有的特征)面向对象编程OOP 先定义类---->实例化出对象查看成绩,交作业 在python3中,所 ...

  6. (转) Myisam和Innodb索引实现的不同(存储结构)

    转自 :  https://blog.csdn.net/donghaixiaolongwang/article/details/60751543

  7. 转载:TCP连接的状态详解以及故障排查

    FROM:http://blog.csdn.net/hguisu/article/details/38700899 该博文的条理清晰,步骤明确,故复制到这个博文中收藏,若文章作者看到且觉得不能装载,麻 ...

  8. POJ1160 Post Office (四边形不等式优化DP)

    There is a straight highway with villages alongside the highway. The highway is represented as an in ...

  9. SSH使用总结(xml配置)

    beans.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="htt ...

  10. iOS 10 隐私权限设置

    iOS 10 开始对隐私权限更加严格,如果你不设置就会直接崩溃,现在很多遇到崩溃问题了,一般解决办法都是在info.plist文件添加对应的Key-Value就可以了. 以上Value值,圈出的红线部 ...