==Cleaning ipos table==
Check to see if the existing keys in the table are valid. We are using issuer, issuedate, statecode as the key.
SELECT COUNT(*)
FROM (SELECT issuer, issuedate, statecode FROM ipos)a;
--10440
SELECT COUNT(*)
FROM (SELECT DISTINCT issuer, issuedate, statecode FROM ipos)a;
--9491
The keys are not unique so we must remove duplicate keys first.
==Creating Stage Flags Table==