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

Major difference between cross join and inner join Expand / Collapse
Author
Message
Posted Tuesday, December 04, 2012 10:16 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Today @ 1:32 AM
Points: 23, Visits: 121
Hi All,


Can any one explain Wat is the main difference between cross apply and inner join???



according to my view

both are functionality wise same syntax wise different



Post #1392785
Posted Tuesday, December 04, 2012 11:43 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 11:06 PM
Points: 179, Visits: 380
While most queries which employ CROSS APPLY can be rewritten using an INNER JOIN, CROSS APPLY can yield better execution plan and better performance, since it can limit the set being joined yet before the join occurs.
Post #1392802
Posted Wednesday, December 05, 2012 1:06 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, March 26, 2013 8:41 AM
Points: 2,562, Visits: 3,451
cooljagadeesh (12/4/2012)
according to my view

both are functionality wise same


can you explain it ?

And for reading http://www.mssqltips.com/sqlservertip/1667/sql-server-join-example/


-------Bhuvnesh----------
While 1 = 1 (Learning SQL....)
Click to get fast response of your post
Post #1392823
Posted Wednesday, December 05, 2012 5:07 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: Monday, May 06, 2013 5:58 AM
Points: 535, Visits: 1,010
Cross join or cross apply? A cross join produces a cartesian products whereas a cross apply applies the values of a result set to a table-valued function.

Using Cross Joins

Using APPLY


Joie Andrew
"Since 1982"
Post #1392926
Posted Wednesday, December 05, 2012 6:56 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 8:21 AM
Points: 5,602, Visits: 10,950
cooljagadeesh (12/4/2012)
Hi All,


Can any one explain Wat is the main difference between cross apply and inner join???



according to my view

both are functionality wise same syntax wise different





They can be completely different. CROSS APPLY doesn't have to reference a table, in which case it's most valuable as a row-level calculator. Read the article by Paul White, linked in my sig.


“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Post #1392990
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse