<?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: Putting Analytical Functions to good use &#8211; find tables with multiple foreign keys to the same referenced table</title>
	<atom:link href="http://technology.amis.nl/2006/10/11/putting-analytical-functions-to-good-use-find-tables-with-multiple-foreign-keys-to-the-same-referenced-table/feed/" rel="self" type="application/rss+xml" />
	<link>http://technology.amis.nl/2006/10/11/putting-analytical-functions-to-good-use-find-tables-with-multiple-foreign-keys-to-the-same-referenced-table/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=putting-analytical-functions-to-good-use-find-tables-with-multiple-foreign-keys-to-the-same-referenced-table</link>
	<description></description>
	<lastBuildDate>Fri, 12 Apr 2013 10:04:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Xaprb</title>
		<link>http://technology.amis.nl/2006/10/11/putting-analytical-functions-to-good-use-find-tables-with-multiple-foreign-keys-to-the-same-referenced-table/#comment-3885</link>
		<dc:creator>Xaprb</dc:creator>
		<pubDate>Mon, 16 Oct 2006 14:29:08 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1353#comment-3885</guid>
		<description><![CDATA[For those working on MySQL, I built a similar feature into a Perl script I recently wrote for MySQL.  It&#039;s published on MySQL Forge at http://forge.mysql.com/projects/view.php?id=157]]></description>
		<content:encoded><![CDATA[<p>For those working on MySQL, I built a similar feature into a Perl script I recently wrote for MySQL.  It&#8217;s published on MySQL Forge at <a href="http://forge.mysql.com/projects/view.php?id=157" rel="nofollow">http://forge.mysql.com/projects/view.php?id=157</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucas Jellema</title>
		<link>http://technology.amis.nl/2006/10/11/putting-analytical-functions-to-good-use-find-tables-with-multiple-foreign-keys-to-the-same-referenced-table/#comment-3884</link>
		<dc:creator>Lucas Jellema</dc:creator>
		<pubDate>Sun, 15 Oct 2006 15:40:15 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1353#comment-3884</guid>
		<description><![CDATA[Roland,

If all I needed is the name of the table with multiple foreign keys then of course you are right. However, I also want to know the names of the foreign keys. I believe that necessitates the use of the LAG and LEAD functions.

You are right that filtering on constraint_type is not really necessary.

Thanks for your comment.

best regards,

Lucas]]></description>
		<content:encoded><![CDATA[<p>Roland,</p>
<p>If all I needed is the name of the table with multiple foreign keys then of course you are right. However, I also want to know the names of the foreign keys. I believe that necessitates the use of the LAG and LEAD functions.</p>
<p>You are right that filtering on constraint_type is not really necessary.</p>
<p>Thanks for your comment.</p>
<p>best regards,</p>
<p>Lucas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roland Bouman</title>
		<link>http://technology.amis.nl/2006/10/11/putting-analytical-functions-to-good-use-find-tables-with-multiple-foreign-keys-to-the-same-referenced-table/#comment-3883</link>
		<dc:creator>Roland Bouman</dc:creator>
		<pubDate>Sun, 15 Oct 2006 10:43:33 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1353#comment-3883</guid>
		<description><![CDATA[Hi Lucas,

nice usage of LAG and LEAD. I think these analytical functions are very powerful and quite useful from time to time.

But couldn&#039;t the original problem, &quot;Table Definitions having multiple foreign keys to the same referenced table&quot;,  be solved using a simpler (and probably faster) method?

select     fk.table_name
from      user_constraints fk
,            user_constraints pk
where     fk.r_constraint_name = pk.constraint_name
and         fk.constraint_type  = &#039;R&#039;
group by fk.table_name
,             pk.table_name
having count(*) &gt; 1

(The fk.constraint_type  = &#039;R&#039; condition is not really necessary, because r_constraint_name will be NULL for any but foreign key constraints, but it does tend to perform better when it is included)

Roland Bouman]]></description>
		<content:encoded><![CDATA[<p>Hi Lucas,</p>
<p>nice usage of LAG and LEAD. I think these analytical functions are very powerful and quite useful from time to time.</p>
<p>But couldn&#8217;t the original problem, &#8220;Table Definitions having multiple foreign keys to the same referenced table&#8221;,  be solved using a simpler (and probably faster) method?</p>
<p>select     fk.table_name<br />
from      user_constraints fk<br />
,            user_constraints pk<br />
where     fk.r_constraint_name = pk.constraint_name<br />
and         fk.constraint_type  = &#8216;R&#8217;<br />
group by fk.table_name<br />
,             pk.table_name<br />
having count(*) &gt; 1</p>
<p>(The fk.constraint_type  = &#8216;R&#8217; condition is not really necessary, because r_constraint_name will be NULL for any but foreign key constraints, but it does tend to perform better when it is included)</p>
<p>Roland Bouman</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucas Jellema</title>
		<link>http://technology.amis.nl/2006/10/11/putting-analytical-functions-to-good-use-find-tables-with-multiple-foreign-keys-to-the-same-referenced-table/#comment-3882</link>
		<dc:creator>Lucas Jellema</dc:creator>
		<pubDate>Thu, 12 Oct 2006 08:44:16 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1353#comment-3882</guid>
		<description><![CDATA[Pete,

Thanks for the compliment and of course you can! I like that.

best regards,

Lucas]]></description>
		<content:encoded><![CDATA[<p>Pete,</p>
<p>Thanks for the compliment and of course you can! I like that.</p>
<p>best regards,</p>
<p>Lucas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete_S</title>
		<link>http://technology.amis.nl/2006/10/11/putting-analytical-functions-to-good-use-find-tables-with-multiple-foreign-keys-to-the-same-referenced-table/#comment-3881</link>
		<dc:creator>Pete_S</dc:creator>
		<pubDate>Wed, 11 Oct 2006 18:43:09 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1353#comment-3881</guid>
		<description><![CDATA[Lucas
A nice example; can I cite it my beginers giude to Analytics paper at UK OUG in November?]]></description>
		<content:encoded><![CDATA[<p>Lucas<br />
A nice example; can I cite it my beginers giude to Analytics paper at UK OUG in November?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
