Project

General

Profile

« Previous | Next » 

Revision 12586

fix: schemas/vegbien.sql: _plots_10_count_of_individuals_per_plot_in_each_project: fixed to handle subplots properly, using new locationevent.place_visit_id

View differences:

trunk/schemas/vegbien.sql
7147 7147
    sum(ao.count) AS individuals
7148 7148
   FROM ((((((public.project p
7149 7149
   JOIN public.source s ON ((p.source_id = s.source_id)))
7150
   JOIN public.locationevent le ON ((p.project_id = le.project_id)))
7151
   JOIN public.locationevent sub_locationevent ON ((sub_locationevent.parent_id = le.locationevent_id)))
7152
   JOIN public.plot l ON ((le.location_id = l.location_id)))
7153
   JOIN public.taxonoccurrence o ON ((sub_locationevent.locationevent_id = o.locationevent_id)))
7150
   JOIN public.place_visit ON ((p.project_id = place_visit.project_id)))
7151
   JOIN public.locationevent le ON ((place_visit.locationevent_id = le.place_visit_id)))
7152
   JOIN public.plot l ON ((place_visit.location_id = l.location_id)))
7153
   JOIN public.taxonoccurrence o ON ((le.locationevent_id = o.locationevent_id)))
7154 7154
   JOIN public.aggregateoccurrence ao ON ((o.taxonoccurrence_id = ao.taxonoccurrence_id)))
7155 7155
  WHERE (s.shortname = ("current_schema"())::text)
7156 7156
  GROUP BY p.projectname, l.authorlocationcode

Also available in: Unified diff