Welcome Guest ( Log In | Register )

Bump Topic Add Reply RSS Feed New Topic New Poll

Outline · [ Standard ] · Linear+

> INNER MERGE JOIN, in T-SQL, what is this?

views
     
TSk town shit
post Feb 10 2019, 03:12 PM, updated 6 months ago

Casual
***
Group: Junior Member
Posts: 374

Joined: Jan 2009
Hi /K, can anyone share what is the usefulness of inner merge join?
I tried to search the net, can't get much info about that. Fyi, this is from the book <<<Microsoft.Press.Exam.Ref.70-761.Querying.Data.with.Transact-SQL>>>

CODE
SELECT EL.country, EL.region, EL.city, EL.numemps, CL.numcusts
FROM dbo.EmpLocations AS EL
INNER MERGE JOIN dbo.CustLocations AS CL
ON EXISTS (SELECT EL.country, EL.region, EL.city
INTERSECT
SELECT CL.country, CL.region, CL.city);


The screenshot below shows two different statements run, and they return the same result:
Attached Image
ragk
post Feb 11 2019, 12:04 PM

BooBoo~
******
Group: Senior Member
Posts: 1,852

Joined: Apr 2009


https://logicalread.com/sql-server-merge-jo...2/#.XGDzkzMzaUk
read multiple explanation, seems like a more efficient join if both are available in order
compared inner join & merge join query, merge join query sort the table b4 it joined it
Attached Image

This post has been edited by ragk: Feb 11 2019, 12:08 PM
TSk town shit
post Feb 12 2019, 11:40 PM

Casual
***
Group: Junior Member
Posts: 374

Joined: Jan 2009
QUOTE(ragk @ Feb 11 2019, 11:04 AM)
https://logicalread.com/sql-server-merge-jo...2/#.XGDzkzMzaUk
read multiple explanation, seems like a more efficient join if both are available in order
compared inner join & merge join query, merge join query sort the table b4 it joined it
Attached Image
*
thanks for explaining

Bump Topic Add ReplyOptions New Topic
 

Switch to:
| Lo-Fi Version
0.0754sec    2.67    6 queries    GZIP Disabled
Time is now: 16th July 2019 - 11:00 AM