{"id":3268,"date":"2011-03-23T21:05:50","date_gmt":"2011-03-23T21:05:50","guid":{"rendered":"https:\/\/test.simple-talk.com\/uncategorized\/sql-joining-to-a-single-row\/"},"modified":"2016-07-28T10:50:21","modified_gmt":"2016-07-28T10:50:21","slug":"sql-joining-to-a-single-row","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/sql-joining-to-a-single-row\/","title":{"rendered":"SQL &#8211; Joining to a Single Row"},"content":{"rendered":"<p>If you have a one-to-many relationship, and you are performing a join on the tables but you only want one record from the &#8220;many&#8221; portion of the relationship, then this is a very helpful link:<\/p>\n<p><a href=\"http:\/\/stackoverflow.com\/questions\/2281551\/tsql-left-join-and-only-last-row-from-right\">http:\/\/stackoverflow.com\/questions\/2281551\/tsql-left-join-and-only-last-row-from-right<\/a><\/p>\n<p>The outer apply appears to be very useful for joining a single row in one table to a very specific single row in another table.&#160; Not sure about efficiency, but it gets the job done.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have a one-to-many relationship, and you are performing a join on the tables but you only want one record from the &#8220;many&#8221; portion of the relationship, then this is a very helpful link: http:\/\/stackoverflow.com\/questions\/2281551\/tsql-left-join-and-only-last-row-from-right The outer apply appears to be very useful for joining a single row in one table to a very&#8230;&hellip;<\/p>\n","protected":false},"author":46738,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[],"coauthors":[],"class_list":["post-3268","post","type-post","status-publish","format-standard","hentry","category-blogs"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/3268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/46738"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=3268"}],"version-history":[{"count":2,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/3268\/revisions"}],"predecessor-version":[{"id":42011,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/3268\/revisions\/42011"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=3268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=3268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=3268"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=3268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}