Cross apply and OUTER apply differences

Source: Internet
Author: User

We know that there is a cross join in SQL Server 2000 that is used for interleaving. In fact, adding cross apply and outer apply is used to intersect table-valued functions (functions that return table result sets), and more importantly, the parameters of this function are fields in another table.

--OUTER APPLY
SELECT *
From Table_1 T1
Cross apply Fn_tablevalue (t1.column_a)

--OUTER APPLY
SELECT *
From Table_1 T1
Outer Apply Fn_tablevalue (t1.column_a)


Cross apply and outer apply for each row in T1 and the derived table (the table-valued function generates a dynamic result set based on the T1 current row data). The difference between cross apply and outer apply is that if a derived table that is generated from a row of T1 is empty, the result set of cross apply does not contain this row of data in T1, and outer apply still contains this row of data, and all the field values of the derived table Are NULL.

Cross apply and OUTER apply differences

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.