Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to match people between separate systems using SQL?
    primarykey
    data
    text
    <p>I would like to know if there is a way to match people between two separate systems, using (mostly) SQL. </p> <p>We have two separate Oracle databases where people are stored. There is no link between the two (i.e. cannot join on person_id); this is intentional. I would like to create a query that checks to see if a given group of people from system A exists in system B.</p> <p>I am able to create tables if that makes it easier. I can also run queries and do some data manipulation in Excel when creating my final report. I am not very familiar with PL/SQL. </p> <p>In system A, we have information about people (name, DOB, soc, sex, etc.). In system B we have the same types of information about people. There could be data entry errors (person enters an incorrect spelling), but I am not going to worry about this too much, other than maybe just comparing the first 4 letters. <a href="https://stackoverflow.com/questions/988050/matching-records-based-on-person-name">This question deals with that problem more specifically</a>.</p> <p>They way I thought about doing this is through correlated subqueries. So, roughly,</p> <pre><code>select a.lastname, a.firstname, a.soc, a.dob, a.gender case when exists (select 1 from b where b.lastname = a.lastname) then 'Y' else 'N' end last_name, case when exists (select 1 from b where b.firstname = a.firstname) then 'Y' else 'N' end first_name, case [etc.] from a </code></pre> <p>This gives me what I want, I think...I can export the results to Excel and then find records that have 3 or more matches. I believe that this shows that a given field from A was found in B. However, I ran this query with just three of these fields and it took over 3 hours to run (I'm looking in 2 years of data). I would like to be able to match on up to 5 criteria (lastname, firstname, gender, date of birth, soc). Additionally, while soc number is the best choice for matching, it is also the piece of data that tends to be missing the most often. What is the best way to do this? Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload