Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

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

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

Enthusiast
*****
Junior Member
757 posts

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~
*******
Senior Member
2,265 posts

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

Enthusiast
*****
Junior Member
757 posts

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

 

Change to:
| Lo-Fi Version
0.0117sec    0.26    6 queries    GZIP Disabled
Time is now: 29th March 2024 - 02:58 AM