Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8326055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:38:37+00:00 2026-06-09T00:38:37+00:00

I would like to add the unique values of tblA to tblB without creating

  • 0

I would like to add the unique values of tblA to tblB without creating duplicate values based on multiple fields. In the following example, FirstName and LastName determine a duplicate, Foo and Source are irrelevant.

tblA:

FirstName  LastName  Foo  Source
John       Doe       1    A
Jane       Doe       2    A
Steve      Smith     3    A
Bill       Johnson   2    A 

tblB:

FirstName  LastName  Foo  Source
John       Doe       1    B
Bob        Smith     5    B
Steve      Smith     4    B 

This is the result I want:

tblA:

FirstName  LastName  Foo  Source
John       Doe       1    A
Jane       Doe       2    A
Steve      Smith     3    A
Bill       Johnson   2    A
Bob        Smith     5    B  

Here’s an equivalent of the code I’ve tried:

INSERT INTO tblA
SELECT B.*
FROM tblB AS B
LEFT JOIN tblA AS A ON A.FirstName = B.FirstName AND A.LastName = B.LastName
WHERE A.FirstName IS NULL

And this is the result I get:

tblA:

FirstName  LastName  Foo  Source
John       Doe       1    A
Jane       Doe       2    A
Steve      Smith     3    A
Bill       Johnson   2    A
John       Doe       1    B
Bob        Smith     5    B 

Steve Smith from tblB is ignored, which is good. John Doe from tblB is added, which is bad. I’ve spent way too much time on this and I’ve inspected the data every way I can think of to ensure John Doe in tblA and tblB are the same first and last name. Any ideas on what could be going wrong?

Update: FYI, on my real tblB, about 10,000 of 30,000 should be moved to tblA. This is actually moving over 21,000. The problem is this is one step of a common process.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:38:39+00:00Added an answer on June 9, 2026 at 12:38 am

    When I try:

    SELECT tbb.*
    FROM tbb 
    LEFT JOIN tba 
    ON (tbb.FirstName = tba.FirstName) 
       AND (tbb.LastName = tba.LastName)
    WHERE (((tba.LastName) Is Null));
    

    The only line returned is:

    Bob        Smith     5    B
    

    Is it possible that John Doe has a hidden character?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have own project and i would like add for this class same as
I have a ListView and each item have a TextView. I would like add
I would like to add a GestureDetector to all views (view groups) of an
I would like to add a custom calculation method to a managed object (which
I would like to add roots to a VirtualTreeView http://www.delphi-gems.com/index.php/controls/virtual-treeview with a thread like
I would like to add a hash into an array using Ruby version 1.8.7:
I would like to add up the number of line changes in an SVN
I would like to add a pop effect when I hover over a SVG
I would like to add a small dice-rolling effect to my Javascript code. I
I would like to add a regular expression character dot . and such a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.