Skip to content

Instantly share code, notes, and snippets.

@dnch
Created July 7, 2011 08:54
Show Gist options
  • Save dnch/1069126 to your computer and use it in GitHub Desktop.
Save dnch/1069126 to your computer and use it in GitHub Desktop.
I'm losing my mind...
SELECT (field_a + field_b + field_c) AS virtual_field, *
FROM "table_name"
WHERE ("table_name".reference_id = 9999 AND (virtual_field > 0))
AND (boolean_field = 't')
ORDER BY virtual_field DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment