Queries for linking bird tracks to wind and flow data

From ecology
Revision as of 10:06, 20 October 2011 by Lyklev (talk | contribs) (Created page with "=== Combining devices with birds === Devices have no information directly about the bird it is attached to; the table 'gps.uva_track_session' can be used to get this information...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Combining devices with birds

Devices have no information directly about the bird it is attached to; the table 'gps.uva_track_session' can be used to get this information:

 SELECT ud.device_info_serial, ts.ring_number
 FROM gps.uva_device ud
 LEFT JOIN gps.uva_track_session ts
   ON ud.device_info_serial = ts.device_info_serial;

Join with the table 'gps.uva_individual':

 SELECT ud.device_info_serial, ui.species
 FROM gps.uva_device ud
 LEFT JOIN gps.uva_track_session ts
   ON ud.device_info_serial = ts.device_info_serial
 LEFT JOIN gps.uva_individual ui
   ON ts.ring_number = ui.ring_number;