查詢在A表有記錄數據,B表沒有記錄數據的SQL

select a.site_planning_id,a.station_type_key from pl_cover_point a where a.station_type_key='440000104001' and a.station_level_key='440000917001' 
and a.site_planning_id not in (select b.site_planning_id from pl_macro_station b)

-- 宏站細化缺少 23147 條

select a.site_planning_id,a.station_type_key from pl_cover_point a where a.station_type_key='440000104002' and a.station_level_key='440000917001' 
and a.site_planning_id not in (select b.site_planning_id from pl_micro_station b)

-- 微小站細化缺少 8838 條

select a.site_planning_id,a.station_type_key from pl_cover_point a where a.station_type_key='440000104003' and a.station_level_key='440000917001' 
and a.site_planning_id not in (select b.site_planning_id from pl_indoor b)

-- 室分站細化缺少 17485 條

select a.site_planning_id,a.station_type_key from pl_cover_point a where a.station_level_key='440000917002' 
and a.site_planning_id not in (select b.site_planning_id from pl_cell b)

-- 小區站細化缺少 0 條

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章