Cross Apply in Sql

  • Hi

    I have a very small question -- What is the difference between Cross Apply and Inner Join.

    what is it that can be achieved using Cross Apply that cannot be using Inner Join.

    Thanks in Advance.

    Azeem.

  • Azzu, here are some links describing APPLY clause ; all the qustions you asked is explained in detail in the link ; i had given the link to the first part, the link to the second part is in the first part itself:

    Link : Understanding and Using APPLY (Part 1) - Paul White[/url]

    I tell you, this is by far the **BEST** article on APPLY i had ever read.. Thanks to Paul White for writing that up 🙂

  • Thanks for the recommendation Cold Coffee 😎

    Azeem, if you have any questions after reading both parts of the article and examining the code samples provided there, please post them here and one of us will try to answer.

    Paul

  • Thank you for the link. I learned something new and very useful.

  • I also love Paul's articles on APPLY and would second that suggestion. If you own or have access to Microsoft SQL Server 2012 High-Performance T-SQL functions by Itzek Ben-Gen there is a great section called "Improved Parallelism with APPLY". It's a just a few pages of some very valuable information.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

Viewing 5 posts - 1 through 4 (of 4 total)

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