Skip to content

Instantly share code, notes, and snippets.

@rjmackay
Created November 14, 2012 23:52
Show Gist options
  • Save rjmackay/4075685 to your computer and use it in GitHub Desktop.
Save rjmackay/4075685 to your computer and use it in GitHub Desktop.
OVL default location query
SELECT incident.id,
incident.location_id,
location.id,
location.latitude,
location.longitude,
form_response.incident_id,
form_response.form_response,
form_response.form_field_id
FROM incident INNER JOIN location ON incident.location_id = location.id
INNER JOIN form_response ON incident.id = form_response.incident_id
WHERE location.latitude='40.695777' AND location.longitude='-100.595541' AND form_response.form_field_id IN (4,5,6,7)
ORDER BY incident.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment