Created
April 13, 2019 13:40
-
-
Save pj4533/6ec241bd230570a2c8c564e5152defbb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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