select concat(radio_mcc,Radio_MNC) as plmn,Radio_Brand,Radio_Network_Generation,left(Test_Timestamp,7) as month,traffic_bytes,traffic_direction,Location_Longitude as longtition,Location_Latitude as latitude cast((180.0 * (cast(floor(cast(Location_Longitude as double) * 20037508.34 / 180.0 / 300) as int) * 300 + 50) / 20037508.34) as decimal(30,10)) as grid_longitude, case when ln(tan((90.0 +cast(Location_Latitude as double)) * pi() / 360.0)) / pi() >1 then cast((57.295779513082323 * (2.0 * atan(exp((cast(floor(20037508.34/300) as int)*300 + 50) /20037508.34 * 3.141592653589793)) - 1.570796326794897)) as decimal(30,10)) when ln(tan((90.0 +cast(Location_Latitude as double)) * pi() / 360.0)) / pi() < -1 then cast((57.295779513082323 * (2.0 * atan(exp((cast(floor(-20037508.34/300) as int)*300 + 50) /20037508.34 * 3.141592653589793)) - 1.570796326794897)) as decimal(30,10)) else cast((57.295779513082323 * (2.0 * atan(exp((cast(floor(ln(tan((90.0 +cast(Location_Latitude as double)) * pi() / 360.0)) / pi() * 20037508/300) as int)*300 + 50) /20037508.34 * 3.141592653589793)) - 1.570796326794897)) as decimal(30,10)) end as grid_latitude, avg(throughput_receive) as download_bps, sum(test_samples) as samples from public_standard.ps04_p3_ntr__no where Radio_Network_Generation not in ('WiFi','Unknown','2G') and concat(radio_mcc,Radio_MNC)!='' and concat(radio_mcc,Radio_MNC) in (select a.plmn from (select concat(radio_mcc,Radio_MNC) as plmn,count(0) as num from public_standard.ps04_p3_ntr__no where concat(radio_mcc,Radio_MNC)!='' group by concat(radio_mcc,Radio_MNC) order by num desc limit 4)a ) group by radio_mcc,Radio_MNC,Radio_Brand,Radio_Network_Generation,month,traffic_bytes,traffic_direction,grid_longitude,grid_latitude,Location_Longitude,Location_Latitude;改为正确写法
时间: 2024-04-10 14:33:28 浏览: 114
解决Oracle没有WM_CONCAT函数.zip
你提供的查询语句有一些错误,请注意以下修改:
```
SELECT
CONCAT(radio_mcc, Radio_MNC) AS plmn,
Radio_Brand,
Radio_Network_Generation,
LEFT(Test_Timestamp, 7) AS month,
traffic_bytes,
traffic_direction,
Location_Longitude AS longtition,
Location_Latitude AS latitude,
CAST((180.0 * (CAST(FLOOR(CAST(Location_Longitude AS DOUBLE) * 20037508.34 / 180.0 / 300) AS INT) * 300 + 50) / 20037508.34) AS DECIMAL(30, 10)) AS grid_longitude,
CASE
WHEN LN(TAN((90.0 + CAST(Location_Latitude AS DOUBLE)) * PI() / 360.0)) / PI() > 1 THEN CAST((57.295779513082323 * (2.0 * ATAN(EXP((CAST(FLOOR(20037508.34 / 300) AS INT) * 300 + 50) / 20037508.34 * 3.141592653589793)) - 1.570796326794897)) AS DECIMAL(30, 10))
WHEN LN(TAN((90.0 + CAST(Location_Latitude AS DOUBLE)) * PI() / 360.0)) / PI() < -1 THEN CAST((57.295779513082323 * (2.0 * ATAN(EXP((CAST(FLOOR(-20037508.34 / 300) AS INT) * 300 + 50) / 20037508.34 * 3.141592653589793)) - 1.570796326794897)) AS DECIMAL(30, 10))
ELSE CAST((57.295779513082323 * (2.0 * ATAN(EXP((CAST(FLOOR(LN(TAN((90.0 + CAST(Location_Latitude AS DOUBLE)) * PI() / 360.0)) / PI() * 20037508 / 300) AS INT) * 300 + 50) / 20037508.34 * 3.141592653589793)) - 1.570796326794897)) AS DECIMAL(30, 10))
END AS grid_latitude,
AVG(throughput_receive) AS download_bps,
SUM(test_samples) AS samples
FROM
public_standard.ps04_p3_ntr__no
WHERE
Radio_Network_Generation NOT IN ('WiFi', 'Unknown', '2G')
AND CONCAT(radio_mcc, Radio_MNC) != ''
AND CONCAT(radio_mcc, Radio_MNC) IN (
SELECT a.plmn
FROM (
SELECT CONCAT(radio_mcc, Radio_MNC) AS plmn, COUNT(0) AS num
FROM public_standard.ps04_p3_ntr__no
WHERE CONCAT(radio_mcc, Radio_MNC) != ''
GROUP BY CONCAT(radio_mcc, Radio_MNC)
ORDER BY num DESC
LIMIT 4
) a
)
GROUP BY
radio_mcc, Radio_MNC, Radio_Brand, Radio_Network_Generation, month, traffic_bytes, traffic_direction, grid_longitude, grid_latitude, Location_Longitude, Location_Latitude;
```
这样修改后的查询语句应该是正确的了。请注意检查你的数据库中的表名和字段名是否与查询语句中的相匹配。
阅读全文