SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


merge join


merge join

Author
Message
sqlfriends
sqlfriends
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10285 Visits: 4195
I would like to create a teacher extract file. The teacher table is in Oralce database.
it has teacher firstname, lastname, id, loginID.
But the loginID only populated for some of the teachers.
so we would like to join a SQlserver table that also have teacher firstname, last name, initials and networkid.

The only thing we can do is to join firstname and last name and some initials to get the teacher networkID.
because the two source tables they don't have other keys to join.
What I prefer is if oracle table loginID is not null then use loginID as networkID, but if it is null then join
the two sources by using last name and first name. and using left join, for I would like to keep all the records in the oralce source.

Is that possible to do this using merge join?

Also when I use left join, I mean both firstname and last name match then get the networkID, I don't want if only one of the two matches then get the networkID, is that merge join doing?

Whenver I use merge join, I feel it is not flexible.
Thanks,
Tee Time
Tee Time
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1053 Visits: 465
I would probably use the merge join to pull all the records into a staging table and then do additional manipulations via creating a view, etc.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search