What is the difference between OUTER APPLY and INNER JOIN in Sql Server?

Asked

Viewed 2,043 times

1

What’s the difference between OUTER APPLY and INNER JOIN in the Sql Server?

I know how the LEFT/RIGHT/INNER JOIN works but I came across the OUTER APPLY I read it but I didn’t fully understand it, it seems to be a kind of INNER JOIN open where it could make an inner subselect acting as a JOIN normal. Would that be it? Or have more things about?

Also how would the performance compare them?

1 answer

1


An OUTER APPLY what you will do is return to null the fields in which there is no match. While Inner Join does not return, it only returns values where there is matching. Null values are not returned.

Without being a rule, I use a lot of apply operators when I need to call a function.

I hope I’ve helped.

  • Could you post an example of OUTER APPLY using function? @Ivan

  • 1

    yes clear no problems, SELECT c.Contactid, c.Firstname, c.Lastname, c.Emailaddress, c.Phone, x * FROM Person.Contact c OUTER APPLY [dbo].ufnGetSalesInfo x WHERE c.Contactid

Browser other questions tagged

You are not signed in. Login or sign up in order to post.