Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

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


Group: General Forum Members
Last Login: Yesterday @ 11:07 AM
Points: 2,015, Visits: 3,810
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.
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: Monday, February 29, 2016 9:46 AM
Points: 555, 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.
Post #1509329
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse