Skip to content

Instantly share code, notes, and snippets.

@pj4533
Created April 13, 2019 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pj4533/6ec241bd230570a2c8c564e5152defbb to your computer and use it in GitHub Desktop.
Save pj4533/6ec241bd230570a2c8c564e5152defbb to your computer and use it in GitHub Desktop.
SELECT * FROM (
SELECT
`dutchess_tax_roll`.`parcel_location_address`,
`dutchess_tax_roll`.`primary_owner`,
`dutchess_tax_roll`.`street_address`,
`dutchess_tax_roll`.`loc_st_name`,
`dutchess_tax_roll`.`city_state_zip_code`,
levenshtein(`dutchess_tax_roll`.`parcel_location_address`, `dutchess_tax_roll`.`street_address`) as lev_distance
FROM `state_boe_active_012219`
RIGHT JOIN `dutchess_tax_roll` ON (
`dutchess_tax_roll`.`parcel_location_address` = `state_boe_active_012219`.`CUSTOM_STREET_ADDRESS`
)
WHERE
(`state_boe_active_012219`.`COUNTYVRNUMBER` IS NULL) &&
(`dutchess_tax_roll`.`prop_class` >= 200) && (`dutchess_tax_roll`.`prop_class` < 300) &&
(`dutchess_tax_roll`.`primary_owner` NOT LIKE CONCAT('%LLC%')) &&
(`dutchess_tax_roll`.`primary_owner` NOT LIKE CONCAT('%Bank Trust%')) &&
(`dutchess_tax_roll`.`primary_owner` NOT LIKE CONCAT('%City of%')) &&
(`dutchess_tax_roll`.`primary_owner` NOT LIKE CONCAT('%N Y S%')) &&
(`dutchess_tax_roll`.`primary_owner` NOT LIKE CONCAT('%Ltd%')) &&
(`dutchess_tax_roll`.`primary_owner` NOT LIKE CONCAT('%Assn%'))
) as inner_table
WHERE (inner_table.lev_distance > 4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment