{"id":1270,"date":"2012-12-08T10:00:31","date_gmt":"2012-12-08T15:00:31","guid":{"rendered":"http:\/\/sqlity.net\/en\/?p=1270"},"modified":"2014-11-13T13:53:29","modified_gmt":"2014-11-13T18:53:29","slug":"a-join-a-day-the-cross-apply","status":"publish","type":"post","link":"https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/","title":{"rendered":"A Join A Day \u2013 The Cross Apply"},"content":{"rendered":"<div>\n<h3>Introduction<\/h3>\n<p>\nThis is the eighth post in my <a href=\"http:\/\/sqlity.net\/en\/1146\/a-join-a-day-introduction\/\">A Join A Day<\/a> series about SQL Server Joins. Make sure to let me know how I am doing or ask your burning join related questions by leaving a comment below.\n<\/p>\n<p>\nThe <span class=\"tt\">CROSS APPLY<\/span> command was introduced with SQL Server 2005. Other than the join commands we have seen so far it is not part of the SQL standard. It's behavior is very similar to that of the <span class=\"tt\">CROSS JOIN<\/span> command that we visited on day four (<a href=\"http:\/\/sqlity.net\/en\/1183\/a-join-a-day-the-cross-join\/\">A Join A Day \u2013 The Cross Join<\/a>). It takes a left and a right row source and joins them together without a join condition. So, these two queries are functionally identical:\n<\/p>\n<div>\n[sql]\nSELECT<br \/>\n    st.Name AS TerritoryName,<br \/>\n    st.CountryRegionCode,<br \/>\n    sr.Name AS SalesReasonName,<br \/>\n    st.TerritoryID,<br \/>\n    sr.SalesReasonID<br \/>\n  FROM Sales.SalesTerritory AS st<br \/>\n  CROSS JOIN Sales.SalesReason AS sr<br \/>\n  ORDER BY TerritoryName, SalesReasonName;<\/p>\n<p>SELECT<br \/>\n    st.Name AS TerritoryName,<br \/>\n    st.CountryRegionCode,<br \/>\n    sr.Name AS SalesReasonName,<br \/>\n    st.TerritoryID,<br \/>\n    sr.SalesReasonID<br \/>\n  FROM Sales.SalesTerritory AS st<br \/>\n  CROSS APPLY Sales.SalesReason AS sr<br \/>\n  ORDER BY TerritoryName, SalesReasonName;<br \/>\n[\/sql]\n<\/p><\/div>\n<p>\nThe big difference is, that the right side of a cross apply can access attributes of the left. Utilizing that, the right side can return a different set of rows for every row on the left side. That is not possible with a normal join.\n<\/p>\n<h3>CROSS APPLY Example<\/h3>\n<p>\nThe cross apply functionality enables us to really tap into the power of table valued functions. In AdventureWorks2008R2 we have one TVF defined: <span class=\"tt\">ufnGetContactInformation<\/span>. It provides detailed information about a person in the database.<br \/>\nUsing cross apply we can now retrieve a list of persons from the Person table and include that additional information from the function in the same result set:\n<\/p>\n<div>\n[sql]\nSELECT  p.BusinessEntityID, p.PersonType, p.EmailPromotion,<br \/>\n        ci.FirstName, ci.LastName, ci.JobTitle, ci.BusinessEntityType<br \/>\nFROM Person.Person AS p<br \/>\nCROSS APPLY dbo.ufnGetContactInformation(p.BusinessEntityID) AS ci;<br \/>\n[\/sql]\n<\/div>\n<p>\nThe result of this query looks like this:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-example.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-example.jpg\" alt=\"A cross apply example\" title=\"A cross apply example\" width=\"1093\" height=\"579\" class=\"aligncenter size-full wp-image-1271\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-example.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-example-300x158.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-example-1024x542.jpg 1024w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nAs you can see, for every one of the 19683 persons the function returned a unique result that the Person row was joined to.\n<\/p>\n<p>On a side note, the <span class=\"tt\">AdventureWorks2008R2.dbo.ufnGetContactInformation<\/span> function is a really good example of how you do not want to write your T-SQL code. I am not going into more detail here. I am just going to ask you to look at the time it took to return not even twenty thousand rows. Check out my <a href=\" http:\/\/sqlity.net\/en\/498\/t-sql-tuesday-24-prox-n-funx\/\">Performance Comparisons of different types of Functions<\/a> for one of the many reasons why this function is so slow.\n<\/p>\n<p>\nAs I did for the joins, I am going to also show another more technical example that demonstrates the exact behavior of the cross apply operator for differing numbers of rows. For that example I am going to create a table <span class=\"tt\">dbo.XML_Data<\/span> like this:\n<\/p>\n<div>\n[sql]\nCREATE TABLE dbo.XML_data(Id INT, val XML);<br \/>\nINSERT INTO dbo.XML_data(id, val)<br \/>\nVALUES (1,'&lt;a&gt;&lt;b name=&quot;row:1, b-node:1&quot; \/&gt;&lt;\/a&gt;'),<br \/>\n       (2,'&lt;a&gt;&lt;b name=&quot;row:2, b-node:1&quot; \/&gt;&lt;b name=&quot;row:2, b-node:2&quot; \/&gt;&lt;\/a&gt;'),<br \/>\n       (3,'&lt;a&gt;&lt;b name=&quot;row:3, b-node:1&quot; \/&gt;&lt;b name=&quot;row:3, b-node:2&quot; \/&gt;&lt;b name=&quot;row:3, b-node:3&quot; \/&gt;&lt;\/a&gt;'),<br \/>\n       (4,'&lt;a&gt;&lt;\/a&gt;');<br \/>\n[\/sql]\n<\/div>\n<p>\nTogether with the XML data type SQL Server introduced the <span class=\"tt\">nodes()<\/span> function. The nodes function takes an X-Query expression and returns all nodes out of a give XML value that match that expression. Each node found will be returned in a separate row. You can think of the nodes function as a powerful find function.\n<\/p>\n<p>\nI am going to use this function to find all the <span class=\"tt\">&lt;b&gt;<\/span> tags in above table:\n<\/p>\n<div>\n[sql]\nSELECT x.Id, x.val, n.b_node.value('@name', 'NVARCHAR(MAX)') b_node_name<br \/>\nFROM dbo.XML_data x<br \/>\nCROSS APPLY x.val.nodes('\/\/b') n(b_node);<br \/>\n[\/sql]\n<\/div>\n<p>\nTo make reading of the output a little easier, the query takes each node and uses the xml value function on it to only return the value of the <span class=\"tt\">name<\/span> attribute of the node. The result is displayed below:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-full-example.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-full-example.jpg\" alt=\"Complete example for cross apply\" title=\"Complete example for cross apply\" width=\"1093\" height=\"579\" class=\"aligncenter size-full wp-image-1273\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-full-example.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-full-example-300x158.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-full-example-1024x542.jpg 1024w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nThe XML value in row 1 contains a single <span class=\"tt\">&lt;b&gt;<\/span> tag, so the nodes function returns one row. The XML value in rows 2 and 3 contain two and three <span class=\"tt\">&lt;b&gt;<\/span> tags respectively, so as expected we see that many rows returned from the nodes function. Finally, the XML value in row 4 does not contain a <span class=\"tt\">&lt;b&gt;<\/span> tag at all. That means that the nodes function does not return a row. Therefore we don't see row 4 at all in the final result.\n<\/p>\n<h3>CROSS APPLY Syntax<\/h3>\n<p>\nSimilar to the cross join syntax, the cross apply syntax is very straight forward: Table1 CORSS APPLY Table2. Remember that instead of a table you can use anything that produces rows, like a sub-query.\n<\/p>\n<p>\nOther than with a cross join however, the order of the two row sources does matter. The second row source can reference attributes of the first and use them for example as parameters to a function call.\n<\/p>\n<h3>CROSS APPLY Operator<\/h3>\n<p>\nAnother similarity to the cross join is that there is no cross apply operator. The cross apply functionality is instead handled by the Nested Loops (Inner Join) operator:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-execution-plan.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-execution-plan.jpg\" alt=\"A cross apply execution plan\" title=\"A cross apply execution plan\" width=\"1093\" height=\"579\" class=\"aligncenter size-full wp-image-1272\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-execution-plan.jpg 1093w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-execution-plan-300x158.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-execution-plan-1024x542.jpg 1024w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><\/a>\n<\/p>\n<p>\nYou can see that the first input to the Nested Loops operator is the scan of the <span class=\"tt\">Person<\/span> table while the second input is the call to the  <span class=\"tt\">ufnGetContactInformation<\/span> function.\n<\/p>\n<h3>Summary<\/h3>\n<p>\nThe <span class=\"tt\">CROSS APPLY<\/span> is a SQL Server specific extension to the SQL standard. It functions similar to a cross apply with the big difference that the right side of the operator can reference attributes of the left side. That allows us to join each left side row to a unique right side result of for example a call to table valued function.\n<\/p>\n<h3>A Join A Day<\/h3>\n<p>\nThis post is part of my December 2012 \"A Join A Day\" blog post series. You can find the table of contents with all posts published so far in the introductory post: <a href=\"http:\/\/sqlity.net\/en\/1146\/a-join-a-day-introduction\/\">A Join A Day \u2013 Introduction<\/a>. Check back there frequently throughout the month.\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The Cross Apply is the topic of this eighth day of the A Join A Day series. The Cross Apply is a unique T-SQL statement that allows us to join a table to a function. Read on for all the details&#8230;<\/p>\n<p> <a href=\"https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/\">[more&#8230;]<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[28,29,5,27,23],"tags":[],"class_list":["post-1270","post","type-post","status-publish","format-standard","hentry","category-a-join-a-day","category-fundamentals","category-general","category-series","category-t-sql-statements"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>A Join A Day \u2013 The Cross Apply - sqlity.net<\/title>\n<meta name=\"description\" content=\"The Cross Apply is the topic of this eighth day of the A Join A Day series. The Cross Apply is a unique T-SQL statement that allows us to join a table to a function. Read on for all the details...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Join A Day \u2013 The Cross Apply - sqlity.net\" \/>\n<meta property=\"og:description\" content=\"The Cross Apply is the topic of this eighth day of the A Join A Day series. The Cross Apply is a unique T-SQL statement that allows us to join a table to a function. Read on for all the details...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/\" \/>\n<meta property=\"og:site_name\" content=\"sqlity.net\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/sqlity.net\" \/>\n<meta property=\"article:published_time\" content=\"2012-12-08T15:00:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-11-13T18:53:29+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-example.jpg\" \/>\n<meta name=\"author\" content=\"Sebastian Meine\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@sqlity\" \/>\n<meta name=\"twitter:site\" content=\"@sqlity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sebastian Meine\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1270\\\/a-join-a-day-the-cross-apply\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1270\\\/a-join-a-day-the-cross-apply\\\/\"},\"author\":{\"name\":\"Sebastian Meine\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"headline\":\"A Join A Day \u2013 The Cross Apply\",\"datePublished\":\"2012-12-08T15:00:31+00:00\",\"dateModified\":\"2014-11-13T18:53:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1270\\\/a-join-a-day-the-cross-apply\\\/\"},\"wordCount\":1082,\"commentCount\":3,\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1270\\\/a-join-a-day-the-cross-apply\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/cross-apply-example.jpg\",\"articleSection\":[\"A Join A Day\",\"Fundamentals\",\"General\",\"Series\",\"T-SQL Statements\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/1270\\\/a-join-a-day-the-cross-apply\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1270\\\/a-join-a-day-the-cross-apply\\\/\",\"url\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1270\\\/a-join-a-day-the-cross-apply\\\/\",\"name\":\"A Join A Day \u2013 The Cross Apply - sqlity.net\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1270\\\/a-join-a-day-the-cross-apply\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1270\\\/a-join-a-day-the-cross-apply\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/cross-apply-example.jpg\",\"datePublished\":\"2012-12-08T15:00:31+00:00\",\"dateModified\":\"2014-11-13T18:53:29+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"description\":\"The Cross Apply is the topic of this eighth day of the A Join A Day series. The Cross Apply is a unique T-SQL statement that allows us to join a table to a function. Read on for all the details...\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1270\\\/a-join-a-day-the-cross-apply\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/1270\\\/a-join-a-day-the-cross-apply\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1270\\\/a-join-a-day-the-cross-apply\\\/#primaryimage\",\"url\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/cross-apply-example.jpg\",\"contentUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/cross-apply-example.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/1270\\\/a-join-a-day-the-cross-apply\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sqlity.net\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A Join A Day \u2013 The Cross Apply\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/sqlity.net\\\/en\\\/\",\"name\":\"sqlity.net\",\"description\":\"Quality for SQL\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/sqlity.net\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\",\"name\":\"Sebastian Meine\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"caption\":\"Sebastian Meine\"},\"sameAs\":[\"http:\\\/\\\/sqlity.net\",\"https:\\\/\\\/x.com\\\/sqlity\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A Join A Day \u2013 The Cross Apply - sqlity.net","description":"The Cross Apply is the topic of this eighth day of the A Join A Day series. The Cross Apply is a unique T-SQL statement that allows us to join a table to a function. Read on for all the details...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/","og_locale":"en_US","og_type":"article","og_title":"A Join A Day \u2013 The Cross Apply - sqlity.net","og_description":"The Cross Apply is the topic of this eighth day of the A Join A Day series. The Cross Apply is a unique T-SQL statement that allows us to join a table to a function. Read on for all the details...","og_url":"https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/","og_site_name":"sqlity.net","article_publisher":"https:\/\/www.facebook.com\/sqlity.net","article_published_time":"2012-12-08T15:00:31+00:00","article_modified_time":"2014-11-13T18:53:29+00:00","og_image":[{"url":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-example.jpg","type":"","width":"","height":""}],"author":"Sebastian Meine","twitter_card":"summary_large_image","twitter_creator":"@sqlity","twitter_site":"@sqlity","twitter_misc":{"Written by":"Sebastian Meine","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/#article","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/"},"author":{"name":"Sebastian Meine","@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"headline":"A Join A Day \u2013 The Cross Apply","datePublished":"2012-12-08T15:00:31+00:00","dateModified":"2014-11-13T18:53:29+00:00","mainEntityOfPage":{"@id":"https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/"},"wordCount":1082,"commentCount":3,"image":{"@id":"https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/#primaryimage"},"thumbnailUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-example.jpg","articleSection":["A Join A Day","Fundamentals","General","Series","T-SQL Statements"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/","url":"https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/","name":"A Join A Day \u2013 The Cross Apply - sqlity.net","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/#primaryimage"},"image":{"@id":"https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/#primaryimage"},"thumbnailUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-example.jpg","datePublished":"2012-12-08T15:00:31+00:00","dateModified":"2014-11-13T18:53:29+00:00","author":{"@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"description":"The Cross Apply is the topic of this eighth day of the A Join A Day series. The Cross Apply is a unique T-SQL statement that allows us to join a table to a function. Read on for all the details...","breadcrumb":{"@id":"https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/#primaryimage","url":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-example.jpg","contentUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2012\/12\/cross-apply-example.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/sqlity.net\/en\/1270\/a-join-a-day-the-cross-apply\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sqlity.net\/en\/"},{"@type":"ListItem","position":2,"name":"A Join A Day \u2013 The Cross Apply"}]},{"@type":"WebSite","@id":"https:\/\/sqlity.net\/en\/#website","url":"https:\/\/sqlity.net\/en\/","name":"sqlity.net","description":"Quality for SQL","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sqlity.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c","name":"Sebastian Meine","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","caption":"Sebastian Meine"},"sameAs":["http:\/\/sqlity.net","https:\/\/x.com\/sqlity"]}]}},"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2wXuw-ku","jetpack-related-posts":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/1270","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/comments?post=1270"}],"version-history":[{"count":0,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/1270\/revisions"}],"wp:attachment":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/media?parent=1270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/categories?post=1270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/tags?post=1270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}