Skip to content

Instantly share code, notes, and snippets.

@ebrelsford
Created August 27, 2013 01:25
Show Gist options
  • Save ebrelsford/6348685 to your computer and use it in GitHub Desktop.
Save ebrelsford/6348685 to your computer and use it in GitHub Desktop.
Get the number of times the text on a sign occurs, as used here: http://cdb.io/15ekzYE
UPDATE sign_application_filings s1
SET text_occurrences = (
SELECT COUNT(DISTINCT(s2.house, s2.street_name))
FROM sign_application_filings s2
WHERE s2.text_on_sign = s1.text_on_sign
)
WHERE text_on_sign != ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment