Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««123»»

APPLY - 2 Expand / Collapse
Author
Message
Posted Monday, October 1, 2012 5:46 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, May 15, 2014 8:37 PM
Points: 589, Visits: 2,437
Never heard of "Apply" before.
Nice to know that "The difference between join and APPLY operator becomes evident when you have a table-valued expression on the right side and you want this table-valued expression to be evaluated for each row from the left table expression"

Learn something again.
Thanks!
Post #1366502
Posted Monday, October 1, 2012 6:01 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 9:47 AM
Points: 1,824, Visits: 1,358
Thanks for the great question.



Everything is awesome!
Post #1366506
Posted Monday, October 1, 2012 7:52 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:09 AM
Points: 6,580, Visits: 8,856
Good question Ron.

If anyone wants to learn more about using the Apply operator, check out the "Using APPLY" links in my signature block for some great articles written by Paul White. He does an excellent job of walking you through it.


Wayne
Microsoft Certified Master: SQL Server 2008
If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
Links: For better assistance in answering your questions, How to ask a question, Performance Problems, Common date/time routines,
CROSS-TABS and PIVOT tables Part 1 & Part 2, Using APPLY Part 1 & Part 2, Splitting Delimited Strings
Post #1366574
Posted Monday, October 1, 2012 10:10 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 10:43 AM
Points: 836, Visits: 1,897
Simply nice one.

ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
Post #1366647
Posted Monday, October 1, 2012 11:27 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 9:38 AM
Points: 3,254, Visits: 1,953
Nice question! Glad I had my coffee first!
Post #1366678
Posted Monday, October 1, 2012 12:58 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Today @ 9:28 AM
Points: 91, Visits: 1,187
Coffee was a prerequisite in order for me to get this right.
Post #1366710
Posted Tuesday, October 2, 2012 8:16 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, June 27, 2014 6:34 AM
Points: 1,537, Visits: 180
I just don't get what to do with this APPLY keyword.

The query can be redone using a LEFT OUTER JOIN, which results in the same output and the same plan.

Is APPLY easier to read for you? Are there cases where APPLY is the only way to go?
Post #1367065
Posted Tuesday, October 2, 2012 8:18 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, June 27, 2014 6:34 AM
Points: 1,537, Visits: 180
Looks like I found an answer. The documentation shows an example where APPLY is used to provide an argument to a table-function that require a parameter. It looks like it can't be done with a JOIN.
Post #1367069
Posted Wednesday, October 3, 2012 12:14 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 9:44 PM
Points: 21,187, Visits: 14,879
Thanks for the question.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1367933
Posted Thursday, October 4, 2012 1:29 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Saturday, May 31, 2014 9:19 PM
Points: 1,128, Visits: 1,162
thanks for the question

~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one
Post #1368198
« Prev Topic | Next Topic »

Add to briefcase ««123»»

Permissions Expand / Collapse