====Output: ptoassigneend_us_identify4====
Some of the city records contain dots. Remove dots, and then match 'city' with ptoassigneend_us_citylist2.
SQL Code:
CREATE TABLE ptoassigneend_us_identify4 AS
SELECT *
FROM ptoassigneend_us_temp5
WHERE city_extracted2 IN (
SELECT citylist
FROM ptoassigneend_us_citylist2) AND
state IS NOT NULL AND state != '' AND
postcode_extracted ~* '\d{5}';
SELECT 38
The remaining records are stored in ptoassigneend_us_temp5.
====Output: ptoassigneend_us_identify5====
One problem for the REMAINING records is that the postcode is missing.
SELECT 136958
Remaining records are in table ptoassigneend_us_temp5 ptoassigneend_us_temp6 (SELECT 239875).