<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Thuan V. Nguyen &#187; subtract join</title>
	<atom:link href="http://www.a8le.com/tag/subtract-join/feed" rel="self" type="application/rss+xml" />
	<link>http://www.a8le.com</link>
	<description>236th Birthday Marines!</description>
	<lastBuildDate>Sun, 15 May 2011 03:51:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>The Subtract Join</title>
		<link>http://www.a8le.com/the-subtract-join</link>
		<comments>http://www.a8le.com/the-subtract-join#comments</comments>
		<pubDate>Tue, 08 Apr 2008 02:13:00 +0000</pubDate>
		<dc:creator>a8le</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[opposite of a join]]></category>
		<category><![CDATA[sql join]]></category>
		<category><![CDATA[subtract join]]></category>

		<guid isPermaLink="false">http://www.a8le.com/archives/46</guid>
		<description><![CDATA[I needed a way of selecting all primary key(s) from a certain table (Table_1) that was not used as a foreign key in a sub-table (Table_2). So I went at it with my SQL know-how to no end. It was obvious that I needed to do a little catching up. I googled the following: • [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.a8le.com/wp-content/uploads/2008/04/subtractjoin.gif" alt="Subtract Join" class="reflect" /></p>
<p>I needed a way of selecting all primary key(s) from a certain table (Table_1) that was not used as a foreign key in a sub-table (Table_2).  So I went at it with my SQL know-how to no end.  It was obvious that I needed to do a little catching up. <img src='http://www.a8le.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I googled the following:</p>
<blockquote><p> •	all instances of unique id not found in sub-table<br />
•	primary key not found as foreign key in sub-table<br />
•	select all rows if not exist in sub-table<br />
•	sql tutorial<br />
•	sql join<br />
•	sql reference<br />
•	sql relational databases</p></blockquote>
<p>…and found nothing useful.  However, my research did lead me to one conclusion… what I needed was the opposite of a join. I googled for it, it as in “opposite of a join”. What I found was a very useful MS KB, <a href="http://support.microsoft.com/kb/136699" title="Subtract Join" target="_blank">http://support.microsoft.com/kb/136699</a>.</p>
<p>The described &#8220;Subtract Join&#8221; was exactly what I was looking for and it works! What’s odd is of all the SQL tutorials I ran into, none of them mentioned the SUBTRACT JOIN. That makes me think there might be a better way of doing this query. Is there a better way? Am I simply not using the right keywords when I search? Anyways, if there is I couldn&#8217;t find it&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.a8le.com/the-subtract-join/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

