<?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: Less known SQL syntax and functions in MySQL</title>
	<atom:link href="http://code.openark.org/blog/mysql/less-known-sql-syntax-and-functions-in-mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://code.openark.org/blog/mysql/less-known-sql-syntax-and-functions-in-mysql</link>
	<description>Blog by Shlomi Noach</description>
	<lastBuildDate>Wed, 01 Feb 2012 20:47:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Discovery of the day: GROUP BY DESC &#124; code.openark.org</title>
		<link>http://code.openark.org/blog/mysql/less-known-sql-syntax-and-functions-in-mysql/comment-page-1#comment-13077</link>
		<dc:creator>Discovery of the day: GROUP BY DESC &#124; code.openark.org</dc:creator>
		<pubDate>Tue, 04 May 2010 09:38:44 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=126#comment-13077</guid>
		<description>[...] are sorted according to the group statement. You can override this by adding ORDER BY NULL (see past post). I wasn&#8217;t aware you can actually control the sort [...]</description>
		<content:encoded><![CDATA[<p>[...] are sorted according to the group statement. You can override this by adding ORDER BY NULL (see past post). I wasn&#8217;t aware you can actually control the sort [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shlomi</title>
		<link>http://code.openark.org/blog/mysql/less-known-sql-syntax-and-functions-in-mysql/comment-page-1#comment-9573</link>
		<dc:creator>shlomi</dc:creator>
		<pubDate>Wed, 20 Jan 2010 06:56:31 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=126#comment-9573</guid>
		<description>@Tim,

There&#039;s some contradiction in your comment, I think. AFAIK, there is no LIMIT in ANSI SQL. Therefore, it is purely a MySQL extension. Thus, there is no &quot;standard SQL way&quot; for doing LIMIT.

Using one syntax over the other is a matter of preference and, in my case, and old habit. I agree using LIMIT with OFFSET is more verbose.

Regards</description>
		<content:encoded><![CDATA[<p>@Tim,</p>
<p>There's some contradiction in your comment, I think. AFAIK, there is no LIMIT in ANSI SQL. Therefore, it is purely a MySQL extension. Thus, there is no "standard SQL way" for doing LIMIT.</p>
<p>Using one syntax over the other is a matter of preference and, in my case, and old habit. I agree using LIMIT with OFFSET is more verbose.</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://code.openark.org/blog/mysql/less-known-sql-syntax-and-functions-in-mysql/comment-page-1#comment-9548</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Tue, 19 Jan 2010 19:24:05 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=126#comment-9548</guid>
		<description>Your Oracle DBA was shocked that you&#039;re using &quot;LIMIT&quot; for pagination because that syntax is a MySQL extension.  The standard SQL way would be &quot;LIMIT 10 OFFSET 60&quot;.

MySQL also supports OFFSET, and it makes it clearer which number is which, so I&#039;m not sure why you&#039;d ever use &quot;LIMIT a,b&quot;.</description>
		<content:encoded><![CDATA[<p>Your Oracle DBA was shocked that you're using "LIMIT" for pagination because that syntax is a MySQL extension.  The standard SQL way would be "LIMIT 10 OFFSET 60".</p>
<p>MySQL also supports OFFSET, and it makes it clearer which number is which, so I'm not sure why you'd ever use "LIMIT a,b".</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kannan</title>
		<link>http://code.openark.org/blog/mysql/less-known-sql-syntax-and-functions-in-mysql/comment-page-1#comment-165</link>
		<dc:creator>Kannan</dc:creator>
		<pubDate>Fri, 19 Dec 2008 06:35:32 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=126#comment-165</guid>
		<description>Good Post for MySQL.</description>
		<content:encoded><![CDATA[<p>Good Post for MySQL.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shlomi</title>
		<link>http://code.openark.org/blog/mysql/less-known-sql-syntax-and-functions-in-mysql/comment-page-1#comment-123</link>
		<dc:creator>shlomi</dc:creator>
		<pubDate>Wed, 17 Dec 2008 05:25:35 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=126#comment-123</guid>
		<description>Hi Jason,

I&#039;ve seen a very bad effect of REPLACE INTO in a production system. The overhead of DELETEing a row, then INSERTing a new one is huge, especially on InnoDB tables. Changing the code to INSERT INTO...ON DUPLICATE KEY reduced the load average on the db machine by factors.</description>
		<content:encoded><![CDATA[<p>Hi Jason,</p>
<p>I've seen a very bad effect of REPLACE INTO in a production system. The overhead of DELETEing a row, then INSERTing a new one is huge, especially on InnoDB tables. Changing the code to INSERT INTO...ON DUPLICATE KEY reduced the load average on the db machine by factors.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://code.openark.org/blog/mysql/less-known-sql-syntax-and-functions-in-mysql/comment-page-1#comment-120</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Wed, 17 Dec 2008 02:14:38 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=126#comment-120</guid>
		<description>I personally like the REPLACE INTO command... same syntax as INSERT INTO, except if it finds a duplicate key, it deletes it and replaces it....

Similar in spirit to the UPDATE... ON DUPLICATE KEY UPDATE, the difference being - REPLACE INTO will delete and then insert so you get incremented auto numbered IDs</description>
		<content:encoded><![CDATA[<p>I personally like the REPLACE INTO command... same syntax as INSERT INTO, except if it finds a duplicate key, it deletes it and replaces it....</p>
<p>Similar in spirit to the UPDATE... ON DUPLICATE KEY UPDATE, the difference being - REPLACE INTO will delete and then insert so you get incremented auto numbered IDs</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A day in the life of&#8230; - Once a nomad, always a nomad</title>
		<link>http://code.openark.org/blog/mysql/less-known-sql-syntax-and-functions-in-mysql/comment-page-1#comment-62</link>
		<dc:creator>A day in the life of&#8230; - Once a nomad, always a nomad</dc:creator>
		<pubDate>Tue, 02 Dec 2008 23:01:17 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=126#comment-62</guid>
		<description>[...] Bookmarked a link on Delicious. Less known SQL syntax and functions in MySQL &#124; code.openark.org [...]</description>
		<content:encoded><![CDATA[<p>[...] Bookmarked a link on Delicious. Less known SQL syntax and functions in MySQL | code.openark.org [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rudy</title>
		<link>http://code.openark.org/blog/mysql/less-known-sql-syntax-and-functions-in-mysql/comment-page-1#comment-47</link>
		<dc:creator>rudy</dc:creator>
		<pubDate>Wed, 26 Nov 2008 01:04:03 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=126#comment-47</guid>
		<description>there is another feature (some would not use this word) in mysql that is stunning in its implication -- &quot;hidden&quot; columns in the GROUP BY

at first, i thought it was an egregious error that mysql would allow a query like this:

SELECT a, b, MAX(c) FROM t GROUP BY a

most databases toss an error about column b in the SELECT clause but not in the GROUP BY

read this article, which completely changed my mind on the issue -- http://rpbouman.blogspot.com/2007/05/debunking-group-by-myths.html (also republished on mysql.com)

keep &quot;functional dependency&quot; in mind (from normalization theory) and see if you don&#039;t agree that it can be exceptionally useful</description>
		<content:encoded><![CDATA[<p>there is another feature (some would not use this word) in mysql that is stunning in its implication -- "hidden" columns in the GROUP BY</p>
<p>at first, i thought it was an egregious error that mysql would allow a query like this:</p>
<p>SELECT a, b, MAX(c) FROM t GROUP BY a</p>
<p>most databases toss an error about column b in the SELECT clause but not in the GROUP BY</p>
<p>read this article, which completely changed my mind on the issue -- <a href="http://rpbouman.blogspot.com/2007/05/debunking-group-by-myths.html" rel="nofollow">http://rpbouman.blogspot.com/2007/05/debunking-group-by-myths.html</a> (also republished on mysql.com)</p>
<p>keep "functional dependency" in mind (from normalization theory) and see if you don't agree that it can be exceptionally useful</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shlomi</title>
		<link>http://code.openark.org/blog/mysql/less-known-sql-syntax-and-functions-in-mysql/comment-page-1#comment-46</link>
		<dc:creator>shlomi</dc:creator>
		<pubDate>Tue, 25 Nov 2008 14:12:05 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=126#comment-46</guid>
		<description>Hi Nils,
CLUSTER in PostgreSQL seems to only work on an index, while 
ALTER TABLE...ORDER BY will work on any columns.</description>
		<content:encoded><![CDATA[<p>Hi Nils,<br />
CLUSTER in PostgreSQL seems to only work on an index, while<br />
ALTER TABLE...ORDER BY will work on any columns.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nils</title>
		<link>http://code.openark.org/blog/mysql/less-known-sql-syntax-and-functions-in-mysql/comment-page-1#comment-45</link>
		<dc:creator>Nils</dc:creator>
		<pubDate>Tue, 25 Nov 2008 12:55:57 +0000</pubDate>
		<guid isPermaLink="false">http://code.openark.org/blog/?p=126#comment-45</guid>
		<description>The ALTER TABLE ... ORDER BY thing is similar to CLUSTER in postgres I think. 

http://www.postgresql.org/docs/8.3/interactive/sql-cluster.html</description>
		<content:encoded><![CDATA[<p>The ALTER TABLE ... ORDER BY thing is similar to CLUSTER in postgres I think. </p>
<p><a href="http://www.postgresql.org/docs/8.3/interactive/sql-cluster.html" rel="nofollow">http://www.postgresql.org/docs/8.3/interactive/sql-cluster.html</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

