<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How to do an OUTER JOIN in Query of Queries</title>
	<atom:link href="http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/</link>
	<description>BealeARTS - Information Ingenuity</description>
	<lastBuildDate>Sun, 08 Jan 2012 11:53:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: David Beale</title>
		<link>http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/comment-page-1/#comment-207</link>
		<dc:creator>David Beale</dc:creator>
		<pubDate>Thu, 08 Jul 2010 10:37:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/#comment-207</guid>
		<description>@Nikos

No its not in CF9

You should just be able to add extra conditions to the main WHERE expression.</description>
		<content:encoded><![CDATA[<p>@Nikos</p>
<p>No its not in CF9</p>
<p>You should just be able to add extra conditions to the main WHERE expression.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nikos</title>
		<link>http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/comment-page-1/#comment-204</link>
		<dc:creator>Nikos</dc:creator>
		<pubDate>Mon, 05 Jul 2010 14:06:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/#comment-204</guid>
		<description>How do you do this if you have 2 join condions?

cond1 &amp; cont2

cheers</description>
		<content:encoded><![CDATA[<p>How do you do this if you have 2 join condions?</p>
<p>cond1 &amp; cont2</p>
<p>cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nikos</title>
		<link>http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/comment-page-1/#comment-203</link>
		<dc:creator>Nikos</dc:creator>
		<pubDate>Mon, 05 Jul 2010 13:53:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/#comment-203</guid>
		<description>is this still not supported in cf9?</description>
		<content:encoded><![CDATA[<p>is this still not supported in cf9?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garrett</title>
		<link>http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/comment-page-1/#comment-86</link>
		<dc:creator>Garrett</dc:creator>
		<pubDate>Fri, 31 Jul 2009 18:10:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/#comment-86</guid>
		<description>I&#039;ve got this set up but the output returns duplicate rows of the list in NOT IN statement rows in addition to the originally selected rows - just without the additional data

Any thoughts?


SELECT *
FROM joinclientquery, GetLossData
WHERE GetLossData.client_number1 = joinclientquery.cclientid 

UNION


SELECT joinclientquery.*, joinQuery.*
FROM joinclientquery, joinQuery
WHERE joinclientquery.cclientid NOT IN (#quotedValueList(GetLossData.client_number1)#)
order by cclientname


sample output

100386										457,466	0	0
100386	100386	1						1	0	457,466	0	0</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got this set up but the output returns duplicate rows of the list in NOT IN statement rows in addition to the originally selected rows &#8211; just without the additional data</p>
<p>Any thoughts?</p>
<p>SELECT *<br />
FROM joinclientquery, GetLossData<br />
WHERE GetLossData.client_number1 = joinclientquery.cclientid </p>
<p>UNION</p>
<p>SELECT joinclientquery.*, joinQuery.*<br />
FROM joinclientquery, joinQuery<br />
WHERE joinclientquery.cclientid NOT IN (#quotedValueList(GetLossData.client_number1)#)<br />
order by cclientname</p>
<p>sample output</p>
<p>100386										457,466	0	0<br />
100386	100386	1						1	0	457,466	0	0</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/comment-page-1/#comment-33</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 26 May 2009 17:43:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/#comment-33</guid>
		<description>Also, as a side note.... if the join field is a string, you&#039;ll need to change the &quot;ValueList&quot; to &quot;QuotedValueList&quot;

But thanks for this great code. I just ran it on Portable Blue Dragon/Jetty, and it works fine.</description>
		<content:encoded><![CDATA[<p>Also, as a side note&#8230;. if the join field is a string, you&#8217;ll need to change the &#8220;ValueList&#8221; to &#8220;QuotedValueList&#8221;</p>
<p>But thanks for this great code. I just ran it on Portable Blue Dragon/Jetty, and it works fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Gorgolione</title>
		<link>http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/comment-page-1/#comment-35</link>
		<dc:creator>Thomas Gorgolione</dc:creator>
		<pubDate>Tue, 03 Feb 2009 20:48:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/#comment-35</guid>
		<description>@Matt - With UNION you need the same amount of columns in the second query result as the first, hence the creation of a &quot;null row&quot; in the first few lines and a join with that row to the second query.  I was kinda wondering that myself before I looked at UNION here: http://www.w3schools.com/sql/sql_union.asp</description>
		<content:encoded><![CDATA[<p>@Matt &#8211; With UNION you need the same amount of columns in the second query result as the first, hence the creation of a &#8220;null row&#8221; in the first few lines and a join with that row to the second query.  I was kinda wondering that myself before I looked at UNION here: <a href="http://www.w3schools.com/sql/sql_union.asp" rel="nofollow">http://www.w3schools.com/sql/sql_union.asp</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/comment-page-1/#comment-34</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Mon, 02 Feb 2009 13:35:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/#comment-34</guid>
		<description>I dont get it.

I am just going through the logic but dont understand why do this:

SELECT *
FROM QueryB
WHERE QueryB.ID = -1

When it return zero rows as no ID matches -1

and then just add 1 row to it.
Can someone enlighten me or am i missing something here...</description>
		<content:encoded><![CDATA[<p>I dont get it.</p>
<p>I am just going through the logic but dont understand why do this:</p>
<p>SELECT *<br />
FROM QueryB<br />
WHERE QueryB.ID = -1</p>
<p>When it return zero rows as no ID matches -1</p>
<p>and then just add 1 row to it.<br />
Can someone enlighten me or am i missing something here&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/comment-page-1/#comment-32</link>
		<dc:creator>David</dc:creator>
		<pubDate>Sat, 02 Aug 2008 14:58:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/#comment-32</guid>
		<description>@Richard

Yes that&#039;s a typo, it should be SELECT QueryA.*, joinQuery.*  I&#039;ve updated the post.

The CROSS JOIN in the second query is used to include the empty columns from the joinQuery to the filtered results from QueryA. This is done to give the results set of a LEFT OUTER JOIN.

I should also state that this technique assumes that the joining columns (.ID) can never have a value of -1. e.g. They are auto-numbers of a primary key.</description>
		<content:encoded><![CDATA[<p>@Richard</p>
<p>Yes that&#8217;s a typo, it should be SELECT QueryA.*, joinQuery.*  I&#8217;ve updated the post.</p>
<p>The CROSS JOIN in the second query is used to include the empty columns from the joinQuery to the filtered results from QueryA. This is done to give the results set of a LEFT OUTER JOIN.</p>
<p>I should also state that this technique assumes that the joining columns (.ID) can never have a value of -1. e.g. They are auto-numbers of a primary key.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: richard white</title>
		<link>http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/comment-page-1/#comment-31</link>
		<dc:creator>richard white</dc:creator>
		<pubDate>Sun, 29 Jun 2008 22:32:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/#comment-31</guid>
		<description>hi,

the code above is not the finished product right? i am trying to replicate it but on the line:

SELECT QueryA.*, joinQuery

joinquery is not a collumn therefore it is producing an error.

Also, you don&#039;t specify a join condition in the second query of your UNION statement, which means that it&#039;ll return a Cartesian product

thanks</description>
		<content:encoded><![CDATA[<p>hi,</p>
<p>the code above is not the finished product right? i am trying to replicate it but on the line:</p>
<p>SELECT QueryA.*, joinQuery</p>
<p>joinquery is not a collumn therefore it is producing an error.</p>
<p>Also, you don&#8217;t specify a join condition in the second query of your UNION statement, which means that it&#8217;ll return a Cartesian product</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/comment-page-1/#comment-29</link>
		<dc:creator>David</dc:creator>
		<pubDate>Thu, 19 Jul 2007 20:56:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.bealearts.co.uk/blog/2007/06/20/how-to-do-an-outer-join-in-query-of-queries/#comment-29</guid>
		<description>&lt;p&gt;@ Pat&lt;/p&gt;
&lt;p&gt;Thanks for spotting that.&lt;/p&gt;
&lt;p&gt;I have updated the post to correct the issue. It makes it a bit more complicated, but at least it works :-)&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>@ Pat</p>
<p>Thanks for spotting that.</p>
<p>I have updated the post to correct the issue. It makes it a bit more complicated, but at least it works <img src='http://www.bealearts.co.uk/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.373 seconds -->

