Skip to content

Instantly share code, notes, and snippets.

@lukecampbell
Created August 3, 2015 20:36
Show Gist options
  • Save lukecampbell/14f756cec1f457848be2 to your computer and use it in GitHub Desktop.
Save lukecampbell/14f756cec1f457848be2 to your computer and use it in GitHub Desktop.
Summary query for cbibs
-- summary
SELECT
s.site_code,
s.description,
vg.group_name,
v.actual_name,
u.netcdf,
svo.last_update_ts,
svo.min_observation_ts,
svo.max_observation_ts,
svo.elevation
FROM cbibs.d_station_variable_ob_stats svo
JOIN cbibs.d_station s on s.id = svo.d_station_id
JOIN cbibs.d_variable v on v.id = svo.d_variable_id
JOIN cbibs.d_units u on v.d_units_id = u.id
JOIN cbibs.d_variable_group vg on v.d_variable_group_id = vg.id
ORDER BY s.description, v.actual_name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment