Commit 5f503a1c authored by Sergio Bruni's avatar Sergio Bruni
Browse files

m

parent 7e21b656
......@@ -1352,3 +1352,28 @@ ORDER BY
w1.reference_date ASC
```
**stazioni con posizione non valorizzata con associata la rete per la quale hanno maggior numero di rinex**
```
WITH t AS (
select rn.id_network, s.id id_station, count(*) num_rinex from rinex_file r
JOIN rinex_file_network rn on rn.id_rinex_file=r.id
JOIN station s on s.id=r.id_station
JOIN location l on l.id = s.id_location
JOIN coordinates c on c.id=l.id_coordinates AND c.x = -1
group by s.id, rn.id_network
)
select t.id_station, max(t.id_network), max(t.num_rinex) num_rinex from (
select id_station, max(num_rinex) num_rinex
from t
GROUP BY id_station
) t1
JOIN
t ON t1.id_station = t.id_station AND t1.num_rinex = t.num_rinex
group by t.id_station
order by t.id_station
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment