?
Solved

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

Posted on 2016-10-13
7
Medium Priority
?
41 Views
Last Modified: 2016-10-13
Is there a work for getting the unique values from 2 tables and putting them into another table?
0
Comment
Question by:zimmer9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 66

Expert Comment

by:Jim Horn
ID: 41842715
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
 

Author Comment

by:zimmer9
ID: 41842719
Sorry, I meant "word".
0
 

Author Comment

by:zimmer9
ID: 41842727
as in a word that signifies pulling in the unique values from 2 tables into 1 universal table of unique values.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 66

Expert Comment

by:Jim Horn
ID: 41842732
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
 

Author Comment

by:zimmer9
ID: 41842769
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
 
LVL 66

Accepted Solution

by:
Jim Horn earned 2000 total points
ID: 41842777
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
 
LVL 66

Expert Comment

by:Jim Horn
ID: 41842800
Thanks for the grade.  Good luck with your project.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question