|
|
|
|
@ -633,4 +633,26 @@ select count(distinct nct_id) from formatted_data_with_planned_enrollment;--48
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
select count(distinct nct_id) from public.view_trial_to_cause; --130
|
|
|
|
|
select count(distinct nct_id) from formatted_data_with_planned_enrollment;--48
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--get durations and count snapshots per trial per trial
|
|
|
|
|
with cte1 as (
|
|
|
|
|
select
|
|
|
|
|
nct_id,
|
|
|
|
|
start_date ,
|
|
|
|
|
primary_completion_date,
|
|
|
|
|
overall_status ,
|
|
|
|
|
primary_completion_date - start_date as duration
|
|
|
|
|
from ctgov.studies s
|
|
|
|
|
where nct_id in (select distinct nct_id from http.download_status ds)
|
|
|
|
|
), cte2 as (
|
|
|
|
|
select nct_id,count(*) as snapshot_count from formatted_data_with_planned_enrollment fdwpe
|
|
|
|
|
group by nct_id
|
|
|
|
|
)
|
|
|
|
|
select a.nct_id, a.overall_status, a.duration,b.snapshot_count
|
|
|
|
|
from cte1 as a
|
|
|
|
|
join cte2 as b
|
|
|
|
|
on a.nct_id=b.nct_id
|
|
|
|
|
;
|
|
|
|
|
|