资源核查-陈学.sql 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. select * from
  2. (select * from sqmdb_cost.station3 where station_sname like '%·ÅÖõã%') st
  3. left join
  4. (select distinct station_sid from sqmdb_cost.equip e where profession='Òƶ¯ÎÞÏß') eq
  5. on st.station_sid=eq.station_sid
  6. where eq.station_sid is null
  7. select station_sid,longitude,latitude from sqmdb_cost.station3 where station_sname like '%·ÅÖõã%'
  8. --4G
  9. select
  10. res.city_name,
  11. res.station_sid,
  12. res.siteid,
  13. nctm.enbid as nctm4g
  14. from
  15. (select distinct
  16. city_name,
  17. station_sid,
  18. (regexp_split_to_array(r.cid, '\.'))[2] AS siteid
  19. FROM (
  20. SELECT dg.city_name,r.station_sid,unnest(string_to_array(r.cell_oid, '|')) AS cid
  21. FROM sqmdb_cost.station_rru r
  22. left join (select distinct city_code,city_name from sqmdb_cost.dict_grid) dg
  23. on r.city_code=dg.city_code
  24. where r.station_sid is not null) r) res
  25. left join
  26. (select distinct enbid from sqmdb_cost.cfg_0_4g_siteinfo) nctm
  27. on res.siteid=nctm.enbid::varchar
  28. --5G
  29. select
  30. res.city_name,
  31. res.station_sid,
  32. res.siteid,
  33. nctm.gnbid as nctm5g
  34. from
  35. (select distinct dg.city_name,station_sid,siteid
  36. from sqmdb_cost.station_aau a
  37. left join (select distinct city_code,city_name from sqmdb_cost.dict_grid) dg
  38. on a.city_code=dg.city_code
  39. where a.station_sid is not null) res
  40. left join
  41. (select distinct gnbid from sqmdb_cost.cfg_0_5g_siteinfo) nctm
  42. on res.siteid=nctm.gnbid::varchar