码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2017-09-12 13:36:58      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:distinct   point   chart   int   and   cad   count   rom   air   

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运行航路条数和总距离

标签:distinct   point   chart   int   and   cad   count   rom   air   

原文地址:http://www.cnblogs.com/mol1995/p/7509326.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!