<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Put NULLS Last on MySQL</title>
	<atom:link href="http://memerocket.com/2006/12/02/put-nulls-last-on-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://memerocket.com/2006/12/02/put-nulls-last-on-mysql/</link>
	<description>Bill Burcham's Launch Platform</description>
	<lastBuildDate>Fri, 15 Jan 2010 14:43:10 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Simon</title>
		<link>http://memerocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-3946</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Fri, 15 Jan 2010 14:43:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.meme-rocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-3946</guid>
		<description>sweet dude thanks for that. saved me big time.</description>
		<content:encoded><![CDATA[<p>sweet dude thanks for that. saved me big time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michiel</title>
		<link>http://memerocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-3942</link>
		<dc:creator>Michiel</dc:creator>
		<pubDate>Mon, 21 Dec 2009 16:15:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.meme-rocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-3942</guid>
		<description>Thanks Roman!!!

Can&#039;t believe mysql does not allow for easier control, but anyway, this seems to work.</description>
		<content:encoded><![CDATA[<p>Thanks Roman!!!</p>
<p>Can&#8217;t believe mysql does not allow for easier control, but anyway, this seems to work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Ellis</title>
		<link>http://memerocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-3909</link>
		<dc:creator>Joe Ellis</dc:creator>
		<pubDate>Thu, 23 Jul 2009 09:55:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.meme-rocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-3909</guid>
		<description>@Roman, that&#039;s a great tip as most of the solutions seem to only work when sorting ascending.  Yours, however, allows you to control both, but still keep the NULLs at the bottom regardless of sort type.</description>
		<content:encoded><![CDATA[<p>@Roman, that&#8217;s a great tip as most of the solutions seem to only work when sorting ascending.  Yours, however, allows you to control both, but still keep the NULLs at the bottom regardless of sort type.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shannon</title>
		<link>http://memerocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-3901</link>
		<dc:creator>Shannon</dc:creator>
		<pubDate>Thu, 28 May 2009 17:07:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.meme-rocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-3901</guid>
		<description>Thank you!</description>
		<content:encoded><![CDATA[<p>Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bburcham</title>
		<link>http://memerocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-1018</link>
		<dc:creator>bburcham</dc:creator>
		<pubDate>Wed, 18 Mar 2009 17:19:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.meme-rocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-1018</guid>
		<description>Oh good one Roman!</description>
		<content:encoded><![CDATA[<p>Oh good one Roman!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roman Kofman</title>
		<link>http://memerocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-1016</link>
		<dc:creator>Roman Kofman</dc:creator>
		<pubDate>Wed, 18 Mar 2009 16:43:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.meme-rocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-1016</guid>
		<description>This should be more intuitive:

&lt;code&gt;:order =&gt; &quot;expected_at IS NULL ASC, expected_at&quot;&lt;/code&gt;

Essentially, (expected_at IS NULL) returns a 0 or 1, and the rows are sorted by that value. A secondary sort is then applied by the expected_at column, with the nulls staying where they are.</description>
		<content:encoded><![CDATA[<p>This should be more intuitive:</p>
<p><code>:order =&gt; "expected_at IS NULL ASC, expected_at"</code></p>
<p>Essentially, (expected_at IS NULL) returns a 0 or 1, and the rows are sorted by that value. A secondary sort is then applied by the expected_at column, with the nulls staying where they are.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank Wöckener</title>
		<link>http://memerocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-1005</link>
		<dc:creator>Frank Wöckener</dc:creator>
		<pubDate>Mon, 09 Feb 2009 18:51:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.meme-rocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-1005</guid>
		<description>If I want to sort a model &quot;Project&quot; (belongs_to :person) by a foreign attribute:

Project.all(:include =&gt; &#039;person&#039;, :order =&gt; &#039;-people.sname DESC&#039;)

it doesn&#039;t throw an error but doesn&#039;t work either. BUT - when I do it like this:

Project.all(:include =&gt; &#039;person&#039;, :order =&gt; &#039;-people.sname DESC, people.sname ASC&#039;)

it magically works - nulls at the end. Very mysterious...</description>
		<content:encoded><![CDATA[<p>If I want to sort a model &#8220;Project&#8221; (belongs_to :person) by a foreign attribute:</p>
<p>Project.all(:include =&gt; &#8216;person&#8217;, :order =&gt; &#8216;-people.sname DESC&#8217;)</p>
<p>it doesn&#8217;t throw an error but doesn&#8217;t work either. BUT &#8211; when I do it like this:</p>
<p>Project.all(:include =&gt; &#8216;person&#8217;, :order =&gt; &#8216;-people.sname DESC, people.sname ASC&#8217;)</p>
<p>it magically works &#8211; nulls at the end. Very mysterious&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Economy</title>
		<link>http://memerocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-948</link>
		<dc:creator>Michael Economy</dc:creator>
		<pubDate>Fri, 12 Dec 2008 07:40:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.meme-rocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-948</guid>
		<description>no way!

mysql is so quirky</description>
		<content:encoded><![CDATA[<p>no way!</p>
<p>mysql is so quirky</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://memerocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-125</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Tue, 01 Jul 2008 16:09:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.meme-rocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-125</guid>
		<description>I haven&#039;t tried that Rick. My guess is that it would partition the results but that it would fail to order by expected_at (for those records having a non-NULL expected_at).</description>
		<content:encoded><![CDATA[<p>I haven&#8217;t tried that Rick. My guess is that it would partition the results but that it would fail to order by expected_at (for those records having a non-NULL expected_at).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick</title>
		<link>http://memerocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-124</link>
		<dc:creator>Rick</dc:creator>
		<pubDate>Tue, 01 Jul 2008 04:46:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.meme-rocket.com/2006/12/02/put-nulls-last-on-mysql/#comment-124</guid>
		<description>What about this?

ORDER BY (expected_at IS NOT NULL)</description>
		<content:encoded><![CDATA[<p>What about this?</p>
<p>ORDER BY (expected_at IS NOT NULL)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
