Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

merge join Expand / Collapse
Author
Message
Posted Saturday, October 26, 2013 12:15 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, August 18, 2014 4:41 PM
Points: 1,770, Visits: 3,202
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,
Post #1508643
Posted Tuesday, October 29, 2013 6:50 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, July 24, 2014 1:50 PM
Points: 532, Visits: 448
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.
Post #1509329
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse