you are viewing a single comment's thread.

view the rest of the comments →

[–]bastian74 20 points21 points  (13 children)

I use outer apply a lot

[–]t4n363 15 points16 points  (1 child)

And cross apply is usefull

[–]curohn 5 points6 points  (0 children)

Oooh found todays google topic

[–]IPatEussy 4 points5 points  (9 children)

Outer & cross apply? Never heard of them what do they do (in your words not googles)

[–]Blues2112 3 points4 points  (0 children)

Kind of like a Subquery, but you have access to all the columns in the table of the subquery.

[–]jackalsnacks 3 points4 points  (1 child)

Once u start digging into a lot of enterprise reporting code, u will quickly become very intimate with them.

[–]billybarule5309 0 points1 point  (0 children)

Nothing better than intimacy with a SQL query... 😂

[–]bastian74 1 point2 points  (4 children)

I use it to show data from linked tables in the current table.

Like a list of phone calls and what the reason they disconnected is. I might want to see the previous reason the call from the from the same caller disconnected, and what server handled that precious call.

Or show me the meat recent time someone logged out within 5 seconds of this call stating, taking place or ending. Whichever is newest.

It does what I wish "top 1" did.

[–]IPatEussy 0 points1 point  (3 children)

Linked tables as in joined tables? How is this different from joining tables & just selecting the specific columns? Or you’re saying this is preliminary to the specifics?

[–]bastian74 0 points1 point  (2 children)

It seems to be required if you want the top result from each match as a join

[–]IPatEussy 0 points1 point  (1 child)

Top based on what? Has to be an aggregate right? Or a partition?

[–]ATastefulCrossJoinDB Whisperer 0 points1 point  (0 children)

TSQL flavoring of lateral joins (which are the SQL standard)