Browse Source

Build a view for browsing survey information

safari-date-fix
Gabbie Burns 1 year ago
parent
commit
4a6a4a6e70
  1. 16
      db_migrations/0005_survey_view.sql

16
db_migrations/0005_survey_view.sql

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
CREATE VIEW "public"."Survey View" AS SELECT colony.name,
data_sheet.date,
data_sheet.start_time,
data_sheet.end_time,
survey_summary.species_code,
survey_summary.total_nests,
survey_summary.total_adults,
survey_summary.total_young,
survey_summary.total_possible_nests,
data_sheet.entered_by_name,
data_sheet.proofed_by,
data_sheet.id
FROM survey_summary
LEFT JOIN data_sheet ON data_sheet.id = survey_summary.data_sheet_id
LEFT JOIN colony ON data_sheet.colony_id = colony.id
WHERE (survey_summary.total_nests + survey_summary.total_adults + survey_summary.total_young + survey_summary.total_possible_nests) > 0;
Loading…
Cancel
Save