Merge join and concatenate into a single table...

  • Hello

    I have this scenario, I am using the northwind database as a sample and within that database I am using just the Orders and the Employees tables, as the data source.

    I have a test database with a table by the name Test_Orders, with three columns, OrderID, EmployeeID, and EmployeeName.

    The Test_Orders table EmployeeName column is to be populated with the concatenated fields FirstName and LastName (select Firstname + ' ' +

    Lastname from employees) from the Employees table in the Northwind database

    I know I have to use a merge join, but I can only map Orders.OrderID to test_Orders.OrderID; Orders.EmployeeID to test_Orders.EmployeeID, but cant to get the Firstname + ' ' + Lastname from employees mapped to Test_Orders. EmployeeName

    Can anyone help?

  • When your source data is already in a single database there is no need for a merge join ... just write a query to bring out the data that you want, including the concatenated field.

    When you say that you cannot map the field, can you say why? I cannot understand why there is any problem whatsoever, so you'll have to go into a bit more detail.

    Phil

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Hello Phill

    I have attached the sample data I am using, but saved the into an excel file (orders and employees), for a better understanding.

    The excel attachment is the sample output (test_orders)

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply