{"id":340,"date":"2018-06-20T12:03:46","date_gmt":"2018-06-20T12:03:46","guid":{"rendered":"http:\/\/dbtut.com\/?p=340"},"modified":"2020-06-11T11:59:41","modified_gmt":"2020-06-11T11:59:41","slug":"join-types-in-sql-server","status":"publish","type":"post","link":"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/","title":{"rendered":"Join Types in SQL Server"},"content":{"rendered":"<p><span style=\"font-size: 1.125rem; font-family: var(--text-font);\">We can combine more than one table through equi-columns in tables and perform joins in a single result set.<\/span><\/p>\n<p>There are a few kinds of join types. The result set will be changed according to the Join type used.<\/p>\n<p>Let&#8217;s go over an example to understand the subject clearly.<\/p>\n<p>The following script will create two tables and add some records into it.<\/p>\n<p>One of the tables will be a &#8220;City&#8221; table and city names will be listed. The other table will include the city&#8217;s famous food.<\/p>\n<pre class=\"lang:default decode:true\">CREATE TABLE City(\n\u00a0\u00a0\u00a0 ID int,\n\u00a0\u00a0\u00a0 CityName varchar(100)\n)\n\nCREATE TABLE FamousFood(\n\u00a0\u00a0\u00a0 ID int,\n\u00a0\u00a0\u00a0 CityID int,\n\u00a0\u00a0\u00a0 FoodName varchar(100)\n)\n\nUSE [Test]\nGO\nINSERT INTO [dbo].[City]([ID],[CityName ])VALUES\u00a0\u00a0\u00a0 (1,'Newyork')\nINSERT INTO [dbo].[City]([ID],[CityName ])VALUES\u00a0\u00a0\u00a0 (42,'Roma')\nINSERT INTO [dbo].[City]([ID],[CityName ])VALUES\u00a0\u00a0\u00a0 (3,'Paris')\nGO\nINSERT INTO [dbo].[FamousFood]([ID],[CityID ],[FoodName ])VALUES\u00a0\u00a0\u00a0 (1,1,'x')\nINSERT INTO [dbo].[FamousFood]([ID],[CityID ],[FoodName ])VALUES\u00a0\u00a0\u00a0 (2,42,'y')\nINSERT INTO [dbo].[FamousFood]([ID],[CityID ],[FoodName ])VALUES\u00a0\u00a0\u00a0 (3,3,'z')<\/pre>\n<p>As you can see in the Script, there is a column named &#8220;CityID&#8221; in the &#8220;FamousFood&#8221; table.<\/p>\n<p>The &#8220;CityID&#8221; column in the &#8220;FamousFood&#8221; table and the &#8220;ID&#8221; column in the &#8220;City&#8221; table are related.<\/p>\n<p>We will use these two columns to join these two tables. When writing scripts with TSQL, we can use the following join types.<\/p>\n<ul>\n<li>JOIN or INNER JOIN (both mean the same thing)<\/li>\n<li>OUTER JOIN<\/li>\n<li>LEFT JOIN or LEFT OUTER JOIN (both mean the same thing)<\/li>\n<li>RIGHT JOIN or RIGHT OUTER JOIN (both mean the same thing)<\/li>\n<li>FULL JOIN or FULL OUTER JOIN (both mean the same thing)<\/li>\n<li>CROSS JOIN<\/li>\n<\/ul>\n<p>The following screenshot makes it easier to understand how join types join tables.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/364.png\" width=\"795\" height=\"624\" \/><\/p>\n<p lang=\"en-US\">You can find the details of the join types I have listed below.<\/p>\n<h3>JOIN or INNER JOIN in SQL Server<\/h3>\n<p>This type of join joins the common records of the two tables.<\/p>\n<p>We can join two tables we created at the beginning of the article with inner join as follows.<\/p>\n<p>By joining two table with the &#8220;ID&#8221; column in the &#8220;City&#8221; table and the &#8220;CityID&#8221; column in the &#8220;FamousFood&#8221; table, we will obtain a result set that shows which city has which famous food.<\/p>\n<pre class=\"lang:default decode:true\">select * from City\nGO\nselect * from FamousFood\nGO\nselect s.CityName,my.FoodName from City s\nINNER JOIN FamousFood my ON s.ID=my.CityID<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/453.png\" width=\"769\" height=\"740\" \/><\/p>\n<p>If we add a record to the &#8220;City&#8221; table and If we do not add the famous food of this city to the &#8220;FamousFood&#8221; table, this record will not be in the result set of the join process.<\/p>\n<p lang=\"en-US\">To test, we will add a record to the &#8220;City&#8221; table, but we will not add the famous food of the city to the &#8220;FamousFood&#8221; table.<\/p>\n<pre class=\"lang:default decode:true\">INSERT INTO [dbo].[City]([ID],[CityName])VALUES(27,'Hongkong')<\/pre>\n<p>When we re-run the INNER JOIN script that we just ran, we will not see a record of Hongkong as you see.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/227.png\" width=\"748\" height=\"327\" \/><\/p>\n<h3>SQL Server Aliases<\/h3>\n<p>The &#8220;s&#8221; at the end of the city table and the &#8220;my&#8221; at the end of the &#8220;FamousFood&#8221; table are called aliases.<\/p>\n<p>This way you can write your scripts more clearly.<\/p>\n<p>As you can see in the script below, if we have defined an alias, we need to use the alias to select the columns we need.<\/p>\n<p>Another goal of Alias \u200b\u200bis that if two tables have columns with the same name and the name of the column is entered directly in select without specifying the alias, you will get an error like this:<\/p>\n<p>The error we get when we try to select the ID column with the same name in our query without Alias:<\/p>\n<pre class=\"lang:default decode:true \">select ID,CityName,FoodName from City s\nINNER JOIN FamousFood my\u00a0 ON s.ID=my.CityID<\/pre>\n<p><em>Msg 209, Level 16, State 1, Line 1<\/em><\/p>\n<p><em>Ambiguous column name &#8216;ID&#8217;.<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/111.png\" width=\"710\" height=\"310\" \/><\/p>\n<h3>OUTER JOIN in SQL Server<\/h3>\n<p>Like INNER JOIN, it uses common columns between tables to join common records.<\/p>\n<p>Unlike INNER JOIN, non-matching rows also can be in result set. You can not use the OUTER JOIN alone by typing OUTER JOIN.<\/p>\n<p>You can use OUTER JOIN as LEFT OUTER JOIN, RIGHT OUTER JOIN, or FULL OUTER JOIN.<\/p>\n<h3><span lang=\"tr\">LEFT JOIN or LEFT OUTER JOIN <\/span><span lang=\"en-US\">in SQL Server(both mean the same thing)<\/span><\/h3>\n<p>The records in the first table are fully returns in the result set. If the second table does not have the counterpart of the record in the first table, the value in the second table returns null.<\/p>\n<p>For example, in the example we wrote an INNER JOIN, we inserted Hongkong in the &#8220;City&#8221; table.<\/p>\n<p>But since we did not insert a record about Hongkong in the &#8220;FamousFood&#8221; table, it was not listed in INNER JOIN.<\/p>\n<p>Let&#8217;s run the same query by typing LEFT JOIN or LEFT OUTER JOIN.<\/p>\n<pre class=\"lang:default decode:true\">select s.CityName,my.FoodName from City s\nLEFT OUTER JOIN FamousFood my ON s.ID=my.CityID<\/pre>\n<p>As you can see below, the value of Hongkong returned in the result set and the &#8220;FoodName&#8221; column in the &#8220;FamousFood&#8221; table was null because there was no record.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/897.png\" width=\"688\" height=\"365\" \/><\/p>\n<p>You can meet your different needs by filtering this query in the where condition.<\/p>\n<p>For example, if we want to list cities which has not famous food, we can write the following query.<\/p>\n<pre class=\"lang:default decode:true\">select s.CityName,my.FoodName from City s\nLEFT OUTER JOIN FamousFood my ON s.ID=my.CityID\nwhere my.CityID is null<\/pre>\n<h3>RIGHT JOIN or RIGHT OUTER JOIN in SQL Server(both mean the same thing)<\/h3>\n<p>It works the same logic as LEFT OUTER JOIN. This time, all the records in the second table returns.<\/p>\n<p>Records that do not correspond in the first table are returned as null.<\/p>\n<p>Let&#8217;s run our query again by turning the query\u00a0 with LEFT OUTER JOIN to RIGHT OUTER JOIN.<\/p>\n<pre class=\"lang:default decode:true\">select s.CityName,my.FoodName from City s\nRIGHT OUTER JOIN FamousFood my ON s.ID=my.CityID<\/pre>\n<p>As you can see in the screenshot below, there is no record of null for &#8220;CityName&#8221;.<\/p>\n<p>Because all of the values \u200b\u200bin the &#8220;CityID&#8221; column in the &#8220;FamousFood&#8221; table are in the &#8220;ID&#8221; column of the &#8220;City&#8221; table.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/765.png\" width=\"682\" height=\"314\" \/><\/p>\n<p>I will add a record to the &#8220;FamousFood&#8221; table with the following script.<\/p>\n<p>And let&#8217;s say this record is 16 for &#8220;CityID&#8221;. The record we will insert will be Bursa&#8217;s Iskender.<\/p>\n<p>But we will not add Bursa to the &#8220;City&#8221; table.<\/p>\n<pre class=\"lang:default decode:true\">INSERT INTO [dbo].[FamousFood]([ID],[CityID],[FoodName])VALUES\u00a0\u00a0\u00a0 (4,16,'Iskender')<\/pre>\n<p>Let&#8217;s run our RIGHT OUTER JOIN script once we&#8217;ve done the Insert operation.<\/p>\n<p>We see the value of Iskender as you see below.<\/p>\n<p>However, since there is no City associated with Iskender on the &#8220;City&#8221; table, the &#8220;CityName&#8221; column is null.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/297.png\" width=\"681\" height=\"364\" \/><\/p>\n<h3><span lang=\"tr\">FULL JOIN or FULL OUTER JOIN in SQL Server(<\/span><span lang=\"en-US\">both mean the same thing<\/span><span lang=\"tr\">)<\/span><\/h3>\n<p>All records in the two tables are returns. But the columns that do not correspond returns empty.<\/p>\n<p>Let&#8217;s run the same script with FULL OUTER JOIN.<\/p>\n<pre class=\"lang:default decode:true\">select s.CityName,my.FoodName from City s\nFULL OUTER JOIN FamousFood my ON s.ID=my.CityID<\/pre>\n<p>As you see below,<\/p>\n<p><span lang=\"en-US\">The value of Hongkong <\/span><span lang=\"tr\">came<\/span><span lang=\"en-US\">, but the food <\/span><span lang=\"tr\">came null<\/span><\/p>\n<p><span lang=\"en-US\">The value of <\/span><span lang=\"tr\">Iskender <\/span><span lang=\"en-US\">came, but the city came null<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/566.png\" width=\"696\" height=\"416\" \/><\/p>\n<h3><span lang=\"tr\">CROSS JOIN in SQL Server<\/span><\/h3>\n<p><span lang=\"en-US\">Gives cartesian multiplication of tables. <\/span><\/p>\n<p lang=\"en-US\">That is, it returns all rows of the table on the right corresponding to each row in the table on the left.<\/p>\n<p><span lang=\"en-US\">I think you can understand better by writing your <\/span><span lang=\"tr\">query <\/span><span lang=\"en-US\">and looking at the result in the following way.<\/span><\/p>\n<pre class=\"lang:default decode:true\">select s.CityName,my.FoodName from City s\nCROSS JOIN FamousFood my<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/167.png\" width=\"747\" height=\"861\" \/><\/p>\n<p>If we write the expression we write in the ON statement in the INNER JOIN, in the where block of the CROSS JOIN, it will work like an INNER JOIN.<\/p>\n<p lang=\"en-US\">When you run the following script, you will see that the CROSS JOIN with the WHERE appended, returns the same result as the INNER JOIN.<\/p>\n<pre class=\"lang:default decode:true\">select s.CityName,my.FoodName from City s\nCROSS JOIN FamousFood my\nwhere s.ID=my.CityID<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/587.png\" width=\"723\" height=\"398\" \/><\/p>\n<p lang=\"en-US\">After this article, you may want to read the article titled &#8220;<a href=\"http:\/\/dbtut.com\/index.php\/2018\/06\/23\/join-types-in-sql-server-execution-plan\/\" target=\"_blank\" rel=\"noopener noreferrer\">JOIN Types in SQL Server Execution Plan<\/a>&#8220;.<\/p>\n<p lang=\"en-US\">\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_340\" class=\"pvc_stats all  \" data-element-id=\"340\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/dbtut.com\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We can combine more than one table through equi-columns in tables and perform joins in a single result set. There are a few kinds of join types. The result set will be changed according to the Join type used. Let&#8217;s go over an example to understand the subject clearly. The following script will create two &hellip;<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_340\" class=\"pvc_stats all  \" data-element-id=\"340\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/dbtut.com\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":15614,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[3],"tags":[398,400,387,9673,392,9672,9670,389,9671,388,9659,9660,396,9658,341,385,395,9666,9664,391,9665,402,401,393,9663,394,9668,9667,390,9669,397,399,9661,386,9662],"class_list":["post-340","post","type-post","status-publish","format-standard","has-post-thumbnail","","category-mssql","tag-alias","tag-ambiguous-column-name","tag-cross-join","tag-cross-join-in-sql-server","tag-full-join","tag-full-join-in-sql-server","tag-full-join-or-full-outer-join-in-sql-server","tag-full-outer-join","tag-full-outer-join-in-sql-server","tag-inner-join","tag-inner-join-in-sql-server","tag-inner-join-in-tsql","tag-join","tag-join-or-inner-join-in-sql-server","tag-join-types","tag-join-types-in-sql-server","tag-left-join","tag-left-join-in-sql-server","tag-left-join-or-left-outer-join-in-sql-server","tag-left-outer-join","tag-left-outer-join-in-sql-server","tag-level-16","tag-msg-209","tag-outer-join","tag-outer-join-in-sql-server","tag-right-join","tag-right-join-in-sql-server","tag-right-join-or-right-outer-join-in-sql-server","tag-right-outer-join","tag-right-outer-join-in-sql-server","tag-sql-joins","tag-sql-server-alias","tag-sql-server-aliases","tag-sql-server-join-types","tag-what-is-alias-in-tsql"],"aioseo_notices":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Join Types in SQL Server - Database Tutorials<\/title>\n<meta name=\"description\" content=\"Join Types in SQL Server\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Join Types in SQL Server - Database Tutorials\" \/>\n<meta property=\"og:description\" content=\"Join Types in SQL Server\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Database Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2018-06-20T12:03:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-06-11T11:59:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/Ads\u0131z-47.png\" \/>\n\t<meta property=\"og:image:width\" content=\"559\" \/>\n\t<meta property=\"og:image:height\" content=\"301\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"dbtut\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"dbtut\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/\"},\"author\":{\"name\":\"dbtut\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/fc047c39e1e53dce28fc4253529ea408\"},\"headline\":\"Join Types in SQL Server\",\"datePublished\":\"2018-06-20T12:03:46+00:00\",\"dateModified\":\"2020-06-11T11:59:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/\"},\"wordCount\":1097,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/dbtut.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/Ads\u0131z-47.png\",\"keywords\":[\"alias\",\"Ambiguous column name\",\"CROSS JOIN\",\"CROSS JOIN in SQL Server\",\"FULL JOIN\",\"FULL JOIN in SQL Server\",\"FULL JOIN or FULL OUTER JOIN in SQL Server\",\"FULL OUTER JOIN\",\"FULL OUTER JOIN in SQL Server\",\"INNER JOIN\",\"INNER JOIN in SQL Server\",\"INNER JOIN in TSQL\",\"JOIN\",\"JOIN or INNER JOIN in SQL Server\",\"join types\",\"Join Types in SQL Server\",\"LEFT JOIN\",\"LEFT JOIN in SQL Server\",\"LEFT JOIN or LEFT OUTER JOIN in SQL Server\",\"LEFT OUTER JOIN\",\"LEFT OUTER JOIN in SQL Server\",\"Level 16\",\"Msg 209\",\"OUTER JOIN\",\"OUTER JOIN in SQL Server\",\"RIGHT JOIN\",\"RIGHT JOIN in SQL Server\",\"RIGHT JOIN or RIGHT OUTER JOIN in SQL Server\",\"RIGHT OUTER JOIN\",\"RIGHT OUTER JOIN in SQL Server\",\"SQL JOINS\",\"sql server alias\",\"SQL Server Aliases\",\"SQL Server Join Types\",\"What is Alias in TSQL\"],\"articleSection\":[\"MSSQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/\",\"url\":\"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/\",\"name\":\"Join Types in SQL Server - Database Tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/dbtut.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/Ads\u0131z-47.png\",\"datePublished\":\"2018-06-20T12:03:46+00:00\",\"dateModified\":\"2020-06-11T11:59:41+00:00\",\"description\":\"Join Types in SQL Server\",\"breadcrumb\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/#primaryimage\",\"url\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/Ads\u0131z-47.png\",\"contentUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/Ads\u0131z-47.png\",\"width\":559,\"height\":301},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dbtut.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Join Types in SQL Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dbtut.com\/#website\",\"url\":\"https:\/\/dbtut.com\/\",\"name\":\"Database Tutorials\",\"description\":\"MSSQL, Oracle, PostgreSQL, MySQL, MariaDB, DB2, Sybase, Teradata, Big Data, NOSQL, MongoDB, Couchbase, Cassandra, Windows, Linux\",\"publisher\":{\"@id\":\"https:\/\/dbtut.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dbtut.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/dbtut.com\/#organization\",\"name\":\"dbtut\",\"url\":\"https:\/\/dbtut.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg\",\"contentUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg\",\"width\":223,\"height\":36,\"caption\":\"dbtut\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/fc047c39e1e53dce28fc4253529ea408\",\"name\":\"dbtut\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c322c32021bf651d9e103b183963c479a9c9791ead0715f4348203496c39aa54?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c322c32021bf651d9e103b183963c479a9c9791ead0715f4348203496c39aa54?s=96&d=mm&r=g\",\"caption\":\"dbtut\"},\"description\":\"We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.\",\"sameAs\":[\"http:\/\/NurullahCAKIR\"],\"url\":\"https:\/\/dbtut.com\/index.php\/author\/dbtut\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Join Types in SQL Server - Database Tutorials","description":"Join Types in SQL Server","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:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/","og_locale":"en_US","og_type":"article","og_title":"Join Types in SQL Server - Database Tutorials","og_description":"Join Types in SQL Server","og_url":"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/","og_site_name":"Database Tutorials","article_published_time":"2018-06-20T12:03:46+00:00","article_modified_time":"2020-06-11T11:59:41+00:00","og_image":[{"width":559,"height":301,"url":"https:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/Ads\u0131z-47.png","type":"image\/png"}],"author":"dbtut","twitter_card":"summary_large_image","twitter_misc":{"Written by":"dbtut","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/#article","isPartOf":{"@id":"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/"},"author":{"name":"dbtut","@id":"https:\/\/dbtut.com\/#\/schema\/person\/fc047c39e1e53dce28fc4253529ea408"},"headline":"Join Types in SQL Server","datePublished":"2018-06-20T12:03:46+00:00","dateModified":"2020-06-11T11:59:41+00:00","mainEntityOfPage":{"@id":"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/"},"wordCount":1097,"commentCount":0,"publisher":{"@id":"https:\/\/dbtut.com\/#organization"},"image":{"@id":"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/Ads\u0131z-47.png","keywords":["alias","Ambiguous column name","CROSS JOIN","CROSS JOIN in SQL Server","FULL JOIN","FULL JOIN in SQL Server","FULL JOIN or FULL OUTER JOIN in SQL Server","FULL OUTER JOIN","FULL OUTER JOIN in SQL Server","INNER JOIN","INNER JOIN in SQL Server","INNER JOIN in TSQL","JOIN","JOIN or INNER JOIN in SQL Server","join types","Join Types in SQL Server","LEFT JOIN","LEFT JOIN in SQL Server","LEFT JOIN or LEFT OUTER JOIN in SQL Server","LEFT OUTER JOIN","LEFT OUTER JOIN in SQL Server","Level 16","Msg 209","OUTER JOIN","OUTER JOIN in SQL Server","RIGHT JOIN","RIGHT JOIN in SQL Server","RIGHT JOIN or RIGHT OUTER JOIN in SQL Server","RIGHT OUTER JOIN","RIGHT OUTER JOIN in SQL Server","SQL JOINS","sql server alias","SQL Server Aliases","SQL Server Join Types","What is Alias in TSQL"],"articleSection":["MSSQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/","url":"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/","name":"Join Types in SQL Server - Database Tutorials","isPartOf":{"@id":"https:\/\/dbtut.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/#primaryimage"},"image":{"@id":"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/Ads\u0131z-47.png","datePublished":"2018-06-20T12:03:46+00:00","dateModified":"2020-06-11T11:59:41+00:00","description":"Join Types in SQL Server","breadcrumb":{"@id":"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/#primaryimage","url":"https:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/Ads\u0131z-47.png","contentUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2018\/06\/Ads\u0131z-47.png","width":559,"height":301},{"@type":"BreadcrumbList","@id":"https:\/\/dbtut.com\/index.php\/2018\/06\/20\/join-types-in-sql-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dbtut.com\/"},{"@type":"ListItem","position":2,"name":"Join Types in SQL Server"}]},{"@type":"WebSite","@id":"https:\/\/dbtut.com\/#website","url":"https:\/\/dbtut.com\/","name":"Database Tutorials","description":"MSSQL, Oracle, PostgreSQL, MySQL, MariaDB, DB2, Sybase, Teradata, Big Data, NOSQL, MongoDB, Couchbase, Cassandra, Windows, Linux","publisher":{"@id":"https:\/\/dbtut.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dbtut.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/dbtut.com\/#organization","name":"dbtut","url":"https:\/\/dbtut.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/#\/schema\/logo\/image\/","url":"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg","contentUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg","width":223,"height":36,"caption":"dbtut"},"image":{"@id":"https:\/\/dbtut.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/dbtut.com\/#\/schema\/person\/fc047c39e1e53dce28fc4253529ea408","name":"dbtut","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c322c32021bf651d9e103b183963c479a9c9791ead0715f4348203496c39aa54?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c322c32021bf651d9e103b183963c479a9c9791ead0715f4348203496c39aa54?s=96&d=mm&r=g","caption":"dbtut"},"description":"We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.","sameAs":["http:\/\/NurullahCAKIR"],"url":"https:\/\/dbtut.com\/index.php\/author\/dbtut\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts\/340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/comments?post=340"}],"version-history":[{"count":0,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts\/340\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/media\/15614"}],"wp:attachment":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/media?parent=340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/categories?post=340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/tags?post=340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}