FROM companybasekeysaddmaskeyaddipokeysmindate as keys;
--44740
Now create the companybaseipokeycore and companybasemaskeycore tables using the flags created above.
DROP TABLE companybasekeymaskeycore;
CREATE TABLE companybasekeymaskeycore AS
SELECT c.coname, c.statecode, c.datefirstinv, c.mastargetname, c.masstatecode, c.announceddate
FROM companybasekeysaddmaskeyaddipokeysmindateflag AS c
WHERE maskeyvalid = 1;
--8610
DROP TABLE companybasekeyipokeycore;
CREATE TABLE companybasekeyipokeycore AS
SELECT c.coname, c.statecode, c.datefirstinv, c.ipoissuer, c.ipostatecode, c.ipoissuedate
FROM companybasekeysaddmaskeyaddipokeysmindateflag AS c
WHERE ipokeyvalid = 1;
--2312
--check = 2350 - 2312 = 38, 8655 - 8610 = 45, 45+38 = 93 (hm something went wrong)
==Name Based Matching companybase keys to ipo keys==