Commit 199dfac6 authored by Sergio Bruni's avatar Sergio Bruni
Browse files

Update queries.md

parent 8d7ae4ef
......@@ -1539,3 +1539,33 @@ rn as (
ASC
```
**Confronto tra due RETI della disponibilità di rinex per una stazione in un periodo**
```
select date, MAX(euref_id) euref_id, MAX(available_euref) available_euref, MAX(igs_id) igs_id, MAX(available_igs) available_igs
FROM (
select
date::date,
(euref.id - euref.id + 0) available_euref,
(igs.id - igs.id + 1) available_igs,
euref.id euref_id,
igs.id igs_id
from generate_series(date '2020-01-01',
date '2020-05-12',
interval '1 day') as t(date)
left join (
select r1.id, r1.reference_date from rinex_file r1
join rinex_file_network rfn
ON rfn.id_rinex_file = r1.id AND rfn.id_network = 21
AND r1.id_station = 2849
) euref ON euref.reference_date = date::date
left join (
select r1.id, r1.reference_date from rinex_file r1
join rinex_file_network rfn
ON rfn.id_rinex_file = r1.id AND rfn.id_network = 9
AND r1.id_station = 2849
) igs ON igs.reference_date = date::date
) tab
GROUP BY date
```
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