Skip to content

Instantly share code, notes, and snippets.

@giacecco
Created July 26, 2015 17:05
Show Gist options
  • Save giacecco/6b603c0dd170570b98e6 to your computer and use it in GitHub Desktop.
Save giacecco/6b603c0dd170570b98e6 to your computer and use it in GitHub Desktop.
# calculate the number of unique properties in the target town recorded in LRPP
lrpp_addresses_no <- collect(tbl(src_postgres("olaf"), sql(paste0("SELECT COUNT(*) AS no_of_addresses FROM (SELECT DISTINCT paon, saon, street FROM lr_pp WHERE town = '", target_town , "') AS a", collapse = ""))))$no_of_addresses
> lrpp_addresses_no
[1] 91933
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment