openpolitics.com

  • writing
  • quotes
  • Topics
    • academia
    • corruption
    • economics
    • education
    • environment
    • finance
    • history
    • hypertext
    • media
    • philosophy
    • psychology
    • religion
    • russia
    • ted nelson
  • about
← Previous Next →

EXPLAIN EXTENDED: INNER JOIN vs. CROSS APPLY

CROSS APPLY is a Microsoft’s extension to SQL, which was originally intended to be used with table-valued functions (TVF‘s).

The query above would look like this:

?
1
2
3
4
5
6
7
8
9
SELECT  *
FROM    table1
CROSS APPLY
(
SELECT  TOP (table1.rowcount) *
FROM    table2
ORDER BY
id
) t2

Postgres equivalent to CROSS APPLY in SQL Server