select 'PBN运行航路' 类型, fb.b 总条数, fa.a 总距离 from
                (
                select sum(s)  a  from (
                            select distinct f4.airway_point1,f4.airway_point2, f4.kilometer_distance S  from airway f1, airway_segment_point f2,airway_segment_point f3, segment f4
                            where
                            f1.chart_type_id=3 and
                            f1.airway_id =f2.airway_id and
                            f1.airway_id =f3.airway_id and
                            f2.airway_seq=f3.airway_seq-1 and
                            (
                            (f2.airway_point_id =f4.airway_point1 and f3.airway_point_id =f4.airway_point2) or
                            (f2.airway_point_id =f4.airway_point2 and f3.airway_point_id =f4.airway_point1)
                            ) and f1.airway_rnp is not null
                            )  tm
                )  fa
                left join
                (select  count(*) b from airway where airway_rnp is not null and chart_type_id=3 )   fb
                on 1=1

纯PBN代号航路

select 'PBN代号航路' 类型, fb.b 总条数, fa.a 总距离 from
                (
                select sum(s)  a  from (
                            select distinct f4.airway_point1,f4.airway_point2, f4.kilometer_distance S  from airway f1, airway_segment_point f2,airway_segment_point f3, segment f4
                            where
                            f1.chart_type_id=3 and
                            f1.airway_id =f2.airway_id and
                            f1.airway_id =f3.airway_id and
                            f2.airway_seq=f3.airway_seq-1 and
                            (
                            (f2.airway_point_id =f4.airway_point1 and f3.airway_point_id =f4.airway_point2) or
                            (f2.airway_point_id =f4.airway_point2 and f3.airway_point_id =f4.airway_point1)
                            ) and f1.airway_type_id in (2,5,8)
                            )  tm
                )  fa
                left join
                (select  count(*) b from airway where airway_type_id in (2,5,8) and chart_type_id=3 )   fb
                on 1=1

CAD库中统计PBN运行航路条数和总距离的更多相关文章

  1. (转)如何在Linux中统计一个进程的线程数

    如何在Linux中统计一个进程的线程数 原文:http://os.51cto.com/art/201509/491728.htm 我正在运行一个程序,它在运行时会派生出多个线程.我想知道程序在运行时会 ...

  2. SQLSERVER中统计所有表的记录数

    SQLSERVER中统计所有表的记录数 利用系统索引表sysindexes中索引ID indid<1的行中的rows列存有该表的行数这一特点.    方法是利用隐藏未公开的系统存储过程sp_MS ...

  3. PHP查询数据库中满足条件的记录条数(二种实现方法)

    在需要输出网站用户注册数或者插入数据之前判断是否有重复记录时,就需要获取满足条件的MySQL查询的记录数目,接下来介绍两种查询统计方法,感兴趣的朋友可以了解下啊,或许对你有所帮助     在需要输出网 ...

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

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

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

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

  6. jmeter中一次运行多条sql语句

    操作比较简单,主要就分两步: 第一步:在JDBC Connection Configuration中设置,主要见下图标注部分增加:?allowMultiQueries=true 第二步:在JDBC R ...

  7. MySQL数据库中统计一个库中的所有表的行数?

    今天公司两个远端的数据库主从同步有点问题,查看下wordpress库下所有表的表的条目? mysql> use information_schema;Database changedmysql& ...

  8. 查询cad库中,所有程序leg引用的点的id,需要预先处理点表和程序表

    select f1.pro_id,f1.pro_type, f1.code_fix_point, f1.code_type_fix_point, f1.code_fir,f2.code_icao,nv ...

  9. 如何在 Linux 中统计一个进程的线程数

    编译自:http://ask.xmodulo.com/number-of-threads-process-linux.html作者: Dan Nanni原创:LCTT https://linux.cn ...

随机推荐

  1. STL标准容器特征

    一. vector vector类是一种顺序容器,可以看作动态数组,容器中的元素存放在连续存储区域. vector容器自动分配.释放.扩展.收缩存储空间,不需要使用new或delete关键字. vec ...

  2. New Concept English three (37)

    28 words/minute 44 typing errors We have learnt to expect that trains will be punctual. After years ...

  3. canvas - 饼状图

    <!DOCTYPE html> <html> <head> <title>Canvas测试</title> <meta charset ...

  4. MySQL 福利彩票业务 如何存储毫秒微秒

    朋友在做福利彩票业务,遇到一个存储毫秒微秒数据的需求,问我mysql里面有何解决方案.我脑中一搜索,以前没有关注到,于是去官网查看,找到11.3.6 Fractional Seconds in Tim ...

  5. Kali Linux安装SSH Server

    Kali Linux默认并没有安装SSH服务,为了实现远程登录Kali Linux,我们需要安装SSH服务. 安装 OpenSSH Server # apt-get install openssh-s ...

  6. HDU - 6433: H. Pow (简答题,输出大数)

    There are n numbers 3^0, 3^1, . . . , 3^n-1. Each time you can choose a subset of them (may be empty ...

  7. 剑指offer-第四章解决面试题思路(字符串的排序)

    题目:输入一个字符串,打印出该字符串的全排列. 思路:将整个字符串分成两部分,第一部分为一个字符,将该字符和该字符后面的字符(直到最后一个字符)依次交换,确定第一个字符:然后固定第一个字符,将后面的字 ...

  8. SQLserver2008使用表达式递归查询

    --由父项递归下级 with cte(id,parentid,text) as ( --父项 select id,parentid,text from treeview where parentid ...

  9. SPOJLCS Longest Common Substring

    题意 A string is finite sequence of characters over a non-empty finite set Σ. In this problem, Σ is th ...

  10. linux 本地账号密码无法登陆(shell可以登录),一直返回 登陆的login界面

    今天我在我虚拟机测试的时候遇到了一个问题.登陆centos一直是返回login,账号和密码没错,我也换了两个用户. 1.问题描述 我正常的输入用户名和密码 错误提示截图:返回登陆界面,我重新试了另外的 ...