Is there a work for getting the unique values from 2 tables and putting them into another table?

Is there a work for getting the unique values from 2 tables and putting them into another table?
zimmer9Asked:
Who is Participating?
 
Jim HornConnect With a Mentor Microsoft SQL Server Developer, Architect, and AuthorCommented:
Since you're asking this question in the SQL Server zone, I'll use that terminology and call this 'UNION all distinct values in two tables'.  Other experts may have slightly different terminology.

SELECT DISTINCT day
FROM (
   SELECT day FROM TableA
   UNION 
   SELECT day FROM TableB) 
WHERE COALESCE(day, '') <> ''

Open in new window


I know you didn't want a SQL statement, but since you're asking we might as well ask that terminology, just to make sure a developer does not mis-understand the requirements.
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Yes, there is 'a work'.  To demonstrate how to pull that off you'll need to give us 'a data mockup' of both source and destination tables, with a description of what values you're trying to pull.
0
 
zimmer9Author Commented:
Sorry, I meant "word".
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
zimmer9Author Commented:
as in a word that signifies pulling in the unique values from 2 tables into 1 universal table of unique values.
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Still not sure what the heck you're asking us, so a data mockup would really work well here.

Let me know if this is what you were thinking:  Table Based Access Variables
0
 
zimmer9Author Commented:
My question is purely one of terminology.

Let's say I have 2 tables comprised of Holidays for different companies as follows:

For example:

table A:              table B:

values                values

Jan  2                  Jan  2
Jan 16                Jan  16
Feb 20               Feb 20
Apr 14    
May 29              May 29
Jul  4                  Jul 4
Sep  4                Sep 4
Oct  9          
                           Nov 11
Nov 23              Nov 23
Dec 25              Dec 25


And I wanted to create another table comprised of the distinct values contained in the 2 tables, is there a terminology for this process. If there isn't, then we can close this question.  :)  

I'm not asking for a SQL statement, just a phrase if I were writing a specification.
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Thanks for the grade.  Good luck with your project.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.