Changes

Jump to navigation Jump to search
1,175 bytes added ,  15:13, 20 July 2017
PA Inc | TX | 2007-09-25 | 2
High Sierra Energy L.P. | CO | 2004-12-23 | 2
Find these records in the matcherportcomas table in Excel and delete 1 entry from each manually:
DELETE FROM matcherportcomasinclude WHERE file1coname = 'PA Inc' AND file1statecode = 'TX' AND file2targetname = 'PA Corp'
AND file2targetstatecode = 'VA';
--1
DELETE FROM matcherportcomasinclude WHERE file1coname = 'High Sierra Energy L.P.' AND file1statecode = 'CO' AND
file2targetname = 'High Sierra Energy GP LLC' AND file2targetstatecode = 'CO';
--1
Now we should have a clean matcherportcomasinclude table. To be sure check the number of distinct matches using the query below. It should be the same as the number of records in this table.
SELECT COUNT(*) FROM
(SELECT DISTINCT file1coname, file1statecode, file1datefirstinv FROM matcherportcomasinclude)a;
--364
SELECT COUNT(*) FROM matcherportcomasinclude;
--364
Looks good so let's UNION ALL to join the matcherportcomasinclude table with the matcherportcomas with all flags set to 0 to create the core table.
CREATE TABLE matcherportcomascore AS
SELECT *
FROM matcherportcomas WHERE excludeflag1 = 0 AND excludeflag2 = 0 AND warningflag = 0
UNION ALL
SELECT *
FROM matcherportcomasinclude;
--8655
==Creating Stage Flags Table==

Navigation menu