SELECT COUNT(DISTINCT firmname) FROM firmbasecore;
--9446
==Cleaning branchoffices==
DROP TABLE branchofficesbase;
CREATE TABLE branchofficesbase AS
SELECT *, CASE
WHEN firmname LIKE '%Undisclosed Firm%' THEN 1::int
ELSE 0::int END AS undisclosedflag
FROM branchoffices;
--9734
SELECT COUNT(*) FROM branchofficesbase WHERE undisclosedflag = 0;
--9452
SELECT COUNT(*) FROM (SELECT DISTINCT firmname, bocity , bozip FROM branchofficesbase WHERE undisclosedflag = 0)a;
--9448
DROP TABLE branchofficecore;
CREATE TABLE branchofficecore AS
SELECT * FROM branchofficesbase WHERE undisclosedflag = 0;
--9452
==Cleaning fundbase==