<?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>Blag o&#039; dkam</title>
	<atom:link href="http://da.nmilne.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://da.nmilne.com</link>
	<description>p0wning tubez</description>
	<lastBuildDate>Sat, 26 Nov 2011 03:40:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Why would I use social media to communicate with a business?</title>
		<link>http://da.nmilne.com/2011/11/why-would-i-use-social-media-to-communicate-with-a-business/</link>
		<comments>http://da.nmilne.com/2011/11/why-would-i-use-social-media-to-communicate-with-a-business/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 03:02:10 +0000</pubDate>
		<dc:creator>dkam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://da.nmilne.com/?p=456</guid>
		<description><![CDATA[With the response being public, it&#8217;s likely I&#8217;ll get something better than &#8220;Thanks for your inquiry, we&#8217;ll respond to you within 48 hours.&#8221;.]]></description>
			<content:encoded><![CDATA[<p>With the response being public, it&#8217;s likely I&#8217;ll get something better than &#8220;Thanks for your inquiry, we&#8217;ll respond to you within 48 hours.&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://da.nmilne.com/2011/11/why-would-i-use-social-media-to-communicate-with-a-business/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MySQL&#8217;s handling of GROUP BY</title>
		<link>http://da.nmilne.com/2011/09/mysqls-handling-of-group-by/</link>
		<comments>http://da.nmilne.com/2011/09/mysqls-handling-of-group-by/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 13:25:22 +0000</pubDate>
		<dc:creator>dkam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Geeky]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://da.nmilne.com/?p=446</guid>
		<description><![CDATA[In the year 2000, I was working on migrating a web application from MySQL to Oracle. One of the issues we had was a number of queries which took advantage of slackness in MySQLs handling of the GROUP BY clause. Oracle took exception to our poor SQL and forced the developers to rewrite queries to [...]]]></description>
			<content:encoded><![CDATA[<p>In the year 2000, I was working on migrating a web application from MySQL to Oracle.  One of the issues we had was a number of queries which took advantage of slackness in MySQLs handling of the GROUP BY clause.  Oracle took exception to our poor SQL and forced the developers to rewrite queries to be a higher standard.  To illustrate the issue, have a look at the following example.</p>
<pre class="brush: sql; title: ; notranslate">
mysql&gt; create table `test1` (`a` int(11), `b` int(11) );
Query OK, 0 rows affected (0.14 sec)

mysql&gt; insert into test1 values (1,2), (1,3);
Query OK, 2 rows affected (0.09 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql&gt; select * from test1;
+------+------+
| a    | b    |
+------+------+
|    1 |    2 |
|    1 |    3 |
+------+------+
2 rows in set (0.00 sec)

mysql&gt; select * from test1 group by a;
+------+------+
| a    | b    |
+------+------+
|    1 |    2 |
+------+------+
1 row in set (0.00 sec)
</pre>
<p>The issue at hand, is the value for the <strong>b</strong> column.  You&#8217;ll note that we&#8217;ve grouped by <strong>a</strong>, so we correctly have a single row result. If you&#8217;re not sure what the issue is, let&#8217;s repopulate the table in a different order and retry.</p>
<pre class="brush: sql; title: ; notranslate">
mysql&gt; truncate test1;
Query OK, 0 rows affected (0.10 sec)

mysql&gt; insert into test1 values (1,3), (1,2);
Query OK, 2 rows affected (0.00 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql&gt; select * from test1;
+------+------+
| a    | b    |
+------+------+
|    1 |    3 |
|    1 |    2 |
+------+------+
2 rows in set (0.00 sec)

mysql&gt; select * from test1 group by a;
+------+------+
| a    | b    |
+------+------+
|    1 |    3 |
+------+------+
1 row in set (0.00 sec)
</pre>
<p>So, the value for <strong>b</strong> was 2 in the first example, and is now 3, with the same data in the table and the same SQL. The problem is that there is no aggregation or GROUP BY clause for <strong>b</strong>. There&#8217;s only one possible value for <strong>a</strong>, but <strong>b</strong> is not aggregated &#8211; there are two possible values: 2 or 3. MySQL just picks one of the two possible values.  Let&#8217;s see what PostgreSQL does.</p>
<pre class="brush: sql; title: ; notranslate">
database=# create temporary table test1 (a integer, b integer);
CREATE TABLE
database=# insert into test1 values (1,2), (1,3);
INSERT 0 2
database=# select * from test1;
 a | b
---+---
 1 | 2
 1 | 3
(2 rows)

database=# select * from test1 group by a;
ERROR:  column &quot;test1.b&quot; must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: select * from test1 group by a;
</pre>
<p>PostgreSQL decides you don&#8217;t want undefined / random data in your result set and lets you know. If you&#8217;re using GROUP BY queries in MySQL, and rely on the result being, you know, correct, it may be time for a quick audit of your SQL.</p>
<p>A quick search of Stack Overflow questions shows many solutions which include this flaw. The solutions work fine on MySQL, but fail on PostgreSQL. </p>
<p>I&#8217;m surprised that 11 years after first learning of MySQL&#8217;s handling of the GROUP BY clause, it has the same behaviour enabled by default. MySQL&#8217;s behaviour can be modified to <a href="http://dev.mysql.com/doc/refman/5.1/en/server-sql-mode.html#sqlmode%5Fonly%5Ffull%5Fgroup%5Fby">behave in a stricter manner</a>. Worth doing if you want to ensure you receive results without including randomly selected data. </p>
]]></content:encoded>
			<wfw:commentRss>http://da.nmilne.com/2011/09/mysqls-handling-of-group-by/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Daemons</title>
		<link>http://da.nmilne.com/2010/08/on-daemons/</link>
		<comments>http://da.nmilne.com/2010/08/on-daemons/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 12:59:25 +0000</pubDate>
		<dc:creator>dkam</dc:creator>
				<category><![CDATA[Booko]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Geeky]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://da.nmilne.com/?p=441</guid>
		<description><![CDATA[New post on Daemons over on the Booko blog.]]></description>
			<content:encoded><![CDATA[<p>New post on <a href="http://blog.booko.com.au/?p=359">Daemons</a> over on the Booko blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://da.nmilne.com/2010/08/on-daemons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s not just Books.</title>
		<link>http://da.nmilne.com/2009/11/its-not-just-books/</link>
		<comments>http://da.nmilne.com/2009/11/its-not-just-books/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 11:18:57 +0000</pubDate>
		<dc:creator>dkam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://da.nmilne.com/?p=429</guid>
		<description><![CDATA[If you had the idea that books were the only thing Australians over paid for (I know, none of you believe that) check this out from Nintendo. The new Super Mario Bros. has an RRP in the US of $49 USD which is $50.235 AUD. You can buy it on Amazon.  According to EBGames, the [...]]]></description>
			<content:encoded><![CDATA[<p>If you had the idea that books were the only thing Australians over paid for (I know, none of you believe that) check this out from Nintendo. The new Super Mario Bros. has an RRP in the US of $49 USD which is $50.235 AUD.  You can buy it on <a href="http://www.amazon.com/gp/product/B002BRZ9G0/ref=s9_simz_gw_s0_p63_i1?pf_rd_m=ATVPDKIKX0DER&amp;pf_rd_s=center-2&amp;pf_rd_r=0BE0G321NJDR49Y47N6V&amp;pf_rd_t=101&amp;pf_rd_p=470938631&amp;pf_rd_i=507846">Amazon</a>.  According to <a href="http://www.ebgames.com.au/wii-147793-New-Super-Mario-Bros-Nintendo-Wii">EBGames</a>, the RRP for the Australian version is $98 AUD, for a markup of almost 100% of the US price.</p>
]]></content:encoded>
			<wfw:commentRss>http://da.nmilne.com/2009/11/its-not-just-books/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google gets some numbers numbers from the world bank</title>
		<link>http://da.nmilne.com/2009/11/google-gets-some-numbers-numbers-from-the-world-bank/</link>
		<comments>http://da.nmilne.com/2009/11/google-gets-some-numbers-numbers-from-the-world-bank/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 02:37:11 +0000</pubDate>
		<dc:creator>dkam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://da.nmilne.com/?p=425</guid>
		<description><![CDATA[Via The Age]]></description>
			<content:encoded><![CDATA[<p><iframe width="600" height="500" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" src="http://www.google.com/publicdata/embed?ds=wb-wdi&amp;met=sh_dyn_mort&amp;idim=country:AUS:USA:NOR:NZL:FIN&amp;tstart=-315619200000&amp;tunit=Y&amp;tlen=47"></iframe></p>
<p>Via <a href="http://news.theage.com.au/breaking-news-technology/google-routes-world-bank-data-to-fact-seekers-20091112-iaax.html">The Age</a></p>
]]></content:encoded>
			<wfw:commentRss>http://da.nmilne.com/2009/11/google-gets-some-numbers-numbers-from-the-world-bank/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Playing on the Master branch</title>
		<link>http://da.nmilne.com/2009/11/playing-on-the-master-branch/</link>
		<comments>http://da.nmilne.com/2009/11/playing-on-the-master-branch/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 12:48:46 +0000</pubDate>
		<dc:creator>dkam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git development]]></category>

		<guid isPermaLink="false">http://da.nmilne.com/?p=424</guid>
		<description><![CDATA[Check it out: http://blog.booko.com.au/?p=319]]></description>
			<content:encoded><![CDATA[<p>Check it out: <a href="http://blog.booko.com.au/?p=319">http://blog.booko.com.au/?p=319</a></p>
]]></content:encoded>
			<wfw:commentRss>http://da.nmilne.com/2009/11/playing-on-the-master-branch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun with git post-commit</title>
		<link>http://da.nmilne.com/2009/10/fun-with-git-post-commit/</link>
		<comments>http://da.nmilne.com/2009/10/fun-with-git-post-commit/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 04:17:57 +0000</pubDate>
		<dc:creator>dkam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://da.nmilne.com/?p=422</guid>
		<description><![CDATA[Over on the Booko Blog.]]></description>
			<content:encoded><![CDATA[<p>Over on the <a href="http://blog.booko.com.au/?p=308">Booko Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://da.nmilne.com/2009/10/fun-with-git-post-commit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Are you an artist in search of prizes to enter?</title>
		<link>http://da.nmilne.com/2009/10/are-you-an-artist-in-search-of-prizes-to-enter/</link>
		<comments>http://da.nmilne.com/2009/10/are-you-an-artist-in-search-of-prizes-to-enter/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 12:16:06 +0000</pubDate>
		<dc:creator>dkam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://da.nmilne.com/?p=417</guid>
		<description><![CDATA[If so, a friend of mine is running an art prize. Check it out: http://www.therealartprize.com/ Entry is free and there&#8217;s a cash prize. Nothing to loose!]]></description>
			<content:encoded><![CDATA[<p>If so, a friend of mine is running an art prize. Check it out: <a href="http://www.therealartprize.com/">http://www.therealartprize.com/</a></p>
<p>Entry is free and there&#8217;s a cash prize. Nothing to loose!</p>
]]></content:encoded>
			<wfw:commentRss>http://da.nmilne.com/2009/10/are-you-an-artist-in-search-of-prizes-to-enter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Users and Passwords</title>
		<link>http://da.nmilne.com/2009/09/on-users-and-passwords/</link>
		<comments>http://da.nmilne.com/2009/09/on-users-and-passwords/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 12:24:10 +0000</pubDate>
		<dc:creator>dkam</dc:creator>
				<category><![CDATA[Booko]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Geeky]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://da.nmilne.com/?p=415</guid>
		<description><![CDATA[Just posted on the Booko Blogo an article about implementing Users and Passwords.]]></description>
			<content:encoded><![CDATA[<p>Just posted on the Booko Blogo an article about implementing <a href="http://blog.booko.com.au/?p=272">Users and Passwords</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://da.nmilne.com/2009/09/on-users-and-passwords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Need a MacBook Pro?</title>
		<link>http://da.nmilne.com/2009/08/need-a-macbook-pro/</link>
		<comments>http://da.nmilne.com/2009/08/need-a-macbook-pro/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 10:32:12 +0000</pubDate>
		<dc:creator>dkam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://da.nmilne.com/?p=403</guid>
		<description><![CDATA[I&#8217;m selling my last one on Ebay right now! Get yourself a bargain!]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m selling my last one on <a href="http://cgi.ebay.com.au/ws/eBayISAPI.dll?ViewItem&amp;item=320418238912">Ebay</a> right now!</p>
<p>Get yourself a bargain!</p>
]]></content:encoded>
			<wfw:commentRss>http://da.nmilne.com/2009/08/need-a-macbook-pro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

