dnet-applications/apps/dnet-exporter-api/src/main/resources/eu/dnetlib/openaire/sql/count_first_collected_datas...

9 lines
230 B
SQL

select count(*) as count
from (
select d.id
from dsm_services d left outer join dsm_api a on (d.id = a.service)
where d._typology_to_remove_ like ?
group by d.id
having min(a.first_collection_date) >= cast(? as date)
) as t