[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

Name Matching

I'm running a Select Query and I'm trying to link two tables, but the problem is the data in my INNER JOIN...  the only data I have to use is FirstName and/or LastName.  Are there any good expressions that can stack the data to lessen the results, without compromising the results?
0
z018196
Asked:
z018196
  • 2
1 Solution
 
Angelp1ayCommented:
Are you already doing JOIN ON t1.FirstName = t2.FirstName AND t1.LastName = t2.LastName?

Is there another field that you could use GROUP BY on?

What do you want? What fields do you have in each table?
0
 
z018196Author Commented:
Yeah, those are the fields I'm already joinging... but I'm getting a lot of duplicates.  Unfortunately, one table is ONLY FirstName and LastName.  Suggestions?
0
 
Angelp1ayCommented:
Why are you joining if 1 table is just first and last names?

I'm thinking you want:

    SELECT * FROM table1 AS t1
    WHERE EXIST
        ( SELECT * FROM table2 AS t2
        WHERE t1.FirstName = t2.FirstName
        AND t1.LastName = t2.LastName);
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now