DELETE FROM ipoinclude WHERE issuer = 'Austria Fund Inc' AND statecode = 'NY';
--2
Now again JOIN your ipos table with your ipoinclude table and check the key count.
DROP TABLE ipocore;
CREATE TABLE ipocore AS
SELECT ipos.issuer, ipos.issuedate, ipos.statecode
FROM ipos INNER JOIN ipoinclude ON ipos.issuer = ipoinclude.issuer AND ipos.issuedate = ipoinclude.issuedate AND
ipos.statecode = ipoinclude.statecode AND ipos.principalamt = ipoinclude.principalamt;
--9470
SELECT COUNT(*)
FROM (SELECT DISTINCT issuer, issuedate, statecode FROM ipocore)a;
--9470
The counts line up so now you should have a clean ipocore table!
==Creating Stage Flags Table==