<?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: MySQL, and the CASE for Class Table Inheritance</title>
	<atom:link href="http://laughingmeme.org/2004/08/14/mysql-and-the-case-for-class-table-inheritance/feed/" rel="self" type="application/rss+xml" />
	<link>http://laughingmeme.org/2004/08/14/mysql-and-the-case-for-class-table-inheritance/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 10 Mar 2010 15:18:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Josef Freundorfer</title>
		<link>http://laughingmeme.org/2004/08/14/mysql-and-the-case-for-class-table-inheritance/comment-page-1/#comment-803982</link>
		<dc:creator>Josef Freundorfer</dc:creator>
		<pubDate>Wed, 23 Dec 2009 02:34:06 +0000</pubDate>
		<guid isPermaLink="false">http://lm.quxx.info/?p=883#comment-803982</guid>
		<description>&lt;p&gt;Thanks for bringing me on the right path.&lt;/p&gt;

&lt;p&gt;I just found out, that there exists two other nice statements, which makes the SQL-Statement a bit shorter.
IFNULL(probablyIsNull,shouldBeUsedInstead)
IF(boolean,trueValue,falseValue)&lt;/p&gt;

&lt;p&gt;more about them:
http://dev.mysql.com/doc/refman/5.5/en/control-flow-functions.html&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for bringing me on the right path.</p>

<p>I just found out, that there exists two other nice statements, which makes the SQL-Statement a bit shorter.
IFNULL(probablyIsNull,shouldBeUsedInstead)
IF(boolean,trueValue,falseValue)</p>

<p>more about them:
<a href="http://dev.mysql.com/doc/refman/5.5/en/control-flow-functions.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.5/en/control-flow-functions.html</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas</title>
		<link>http://laughingmeme.org/2004/08/14/mysql-and-the-case-for-class-table-inheritance/comment-page-1/#comment-682142</link>
		<dc:creator>Thomas</dc:creator>
		<pubDate>Thu, 12 Feb 2009 16:23:44 +0000</pubDate>
		<guid isPermaLink="false">http://lm.quxx.info/?p=883#comment-682142</guid>
		<description>&lt;p&gt;There is no big difference compared to the Single Table Inheritance attempt, is there? To get data out of the split tables you use, you join them back to a single table. What benefits does CTI give you having in mind, you have to join all those tables back to one?&lt;/p&gt;

&lt;p&gt;BTW: The Case-statement gives you a wrong order, sometimes. Image &quot;Tom Roberts&quot; and &quot;Jim Robertson&quot;&lt;/p&gt;

&lt;p&gt;Anyways, good article. Helped me sort my mind :-)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>There is no big difference compared to the Single Table Inheritance attempt, is there? To get data out of the split tables you use, you join them back to a single table. What benefits does CTI give you having in mind, you have to join all those tables back to one?</p>

<p>BTW: The Case-statement gives you a wrong order, sometimes. Image &#8220;Tom Roberts&#8221; and &#8220;Jim Robertson&#8221;</p>

<p>Anyways, good article. Helped me sort my mind <img src='http://laughingmeme.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>]]></content:encoded>
	</item>
	<item>
		<title>By: Bas van Gaalen</title>
		<link>http://laughingmeme.org/2004/08/14/mysql-and-the-case-for-class-table-inheritance/comment-page-1/#comment-225642</link>
		<dc:creator>Bas van Gaalen</dc:creator>
		<pubDate>Thu, 31 Jan 2008 19:47:58 +0000</pubDate>
		<guid isPermaLink="false">http://lm.quxx.info/?p=883#comment-225642</guid>
		<description>&lt;p&gt;Interesting article, thanks for sharing. I think Alex&#039; point is the &#039;is not null&#039; part in the case. The select of &#039;c.contactType&#039; would then indeed be unnecessary (but probably not unwanted).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Interesting article, thanks for sharing. I think Alex&#8217; point is the &#8216;is not null&#8217; part in the case. The select of &#8216;c.contactType&#8217; would then indeed be unnecessary (but probably not unwanted).</p>]]></content:encoded>
	</item>
	<item>
		<title>By: kellan</title>
		<link>http://laughingmeme.org/2004/08/14/mysql-and-the-case-for-class-table-inheritance/comment-page-1/#comment-112524</link>
		<dc:creator>kellan</dc:creator>
		<pubDate>Wed, 26 Sep 2007 17:34:19 +0000</pubDate>
		<guid isPermaLink="false">http://lm.quxx.info/?p=883#comment-112524</guid>
		<description>&lt;p&gt;Hey Alex, thanks for the comment, but I&#039;m not sure I see what you&#039;re getting at. (though I do like the technique of moving the CASE statement to the order by for this example)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hey Alex, thanks for the comment, but I&#8217;m not sure I see what you&#8217;re getting at. (though I do like the technique of moving the CASE statement to the order by for this example)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Barrett</title>
		<link>http://laughingmeme.org/2004/08/14/mysql-and-the-case-for-class-table-inheritance/comment-page-1/#comment-105414</link>
		<dc:creator>Alex Barrett</dc:creator>
		<pubDate>Mon, 17 Sep 2007 20:05:14 +0000</pubDate>
		<guid isPermaLink="false">http://lm.quxx.info/?p=883#comment-105414</guid>
		<description>&lt;p&gt;The contactType column in your base table is unnecessary, the same should be achievable with something similar to the following:&lt;/p&gt;

&lt;p&gt;SELECT 
  c.id as id, c.contactType,
  i.firstName, i.lastName,
  o.name as orgName
FROM
  Contact as c
LEFT JOIN Individual as i ON i.id = c.id 
LEFT JOIN Organization as o ON o.id = c.id
ORDER BY
CASE 
 WHEN i.id IS NOT NULL THEN CONCAT(i.lastName, i.firstName)
 WHEN o.id IS NOT NULL THEN o.name
END&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The contactType column in your base table is unnecessary, the same should be achievable with something similar to the following:</p>

<p>SELECT 
  c.id as id, c.contactType,
  i.firstName, i.lastName,
  o.name as orgName
FROM
  Contact as c
LEFT JOIN Individual as i ON i.id = c.id 
LEFT JOIN Organization as o ON o.id = c.id
ORDER BY
CASE 
 WHEN i.id IS NOT NULL THEN CONCAT(i.lastName, i.firstName)
 WHEN o.id IS NOT NULL THEN o.name
END</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Discovering Single Table Inheritance &#171; Digital Spaghetti</title>
		<link>http://laughingmeme.org/2004/08/14/mysql-and-the-case-for-class-table-inheritance/comment-page-1/#comment-45087</link>
		<dc:creator>Discovering Single Table Inheritance &#171; Digital Spaghetti</dc:creator>
		<pubDate>Wed, 16 May 2007 15:38:04 +0000</pubDate>
		<guid isPermaLink="false">http://lm.quxx.info/?p=883#comment-45087</guid>
		<description>&lt;p&gt;[...] Edit: Well they are cool, but it seems that CakePHP&#8217;s paginate functionality doesn&#8217;t like my custom findAll() function and likes to spit out warnings and errors. Due to deadlines, I&#8217;m going to have to abandon this line of enquiry - but not forever! Once I pass my current milestone, it&#8217;ll be something I&#8217;ll look at again - maybe even look at Class Table Inheritance as another option. [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] Edit: Well they are cool, but it seems that CakePHP&#8217;s paginate functionality doesn&#8217;t like my custom findAll() function and likes to spit out warnings and errors. Due to deadlines, I&#8217;m going to have to abandon this line of enquiry &#8211; but not forever! Once I pass my current milestone, it&#8217;ll be something I&#8217;ll look at again &#8211; maybe even look at Class Table Inheritance as another option. [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jordi B</title>
		<link>http://laughingmeme.org/2004/08/14/mysql-and-the-case-for-class-table-inheritance/comment-page-1/#comment-20513</link>
		<dc:creator>Jordi B</dc:creator>
		<pubDate>Thu, 15 Mar 2007 21:02:41 +0000</pubDate>
		<guid isPermaLink="false">http://lm.quxx.info/?p=883#comment-20513</guid>
		<description>&lt;p&gt;Just what I was looking for. Thanks!!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Just what I was looking for. Thanks!!</p>]]></content:encoded>
	</item>
</channel>
</rss>
