<?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: Fun with reserved words in MySQL 5</title>
	<atom:link href="http://www.chapter31.com/2008/10/27/fun-with-reserved-words-in-mysql-5/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chapter31.com/2008/10/27/fun-with-reserved-words-in-mysql-5/</link>
	<description>Rich Internet Application development</description>
	<lastBuildDate>Tue, 31 Jan 2012 15:10:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Constantin Barb</title>
		<link>http://www.chapter31.com/2008/10/27/fun-with-reserved-words-in-mysql-5/comment-page-1/#comment-114934</link>
		<dc:creator>Constantin Barb</dc:creator>
		<pubDate>Fri, 02 Apr 2010 22:37:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/?p=476#comment-114934</guid>
		<description>I often use back-ticks with MySQL, these are MySQL native for calling db names and columns.
So, I use column names like `group` or `key` with no problem.
The back-tick have more power than that :)
Back-ticks can be used to retrive aliases with spaces in names :)
Your post is old, but you may try:

SELECT id , date_format(dt_start, &quot;%d/%m/%Y&quot;) as `Date Start` , date_format(dt_end, &quot;%d/%m/%Y&quot;) as `Date End` , `repeat` as `rpt` FROM smsschedule</description>
		<content:encoded><![CDATA[<p>I often use back-ticks with MySQL, these are MySQL native for calling db names and columns.<br />
So, I use column names like `group` or `key` with no problem.<br />
The back-tick have more power than that <img src='http://www.chapter31.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Back-ticks can be used to retrive aliases with spaces in names <img src='http://www.chapter31.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Your post is old, but you may try:</p>
<p>SELECT id , date_format(dt_start, &#8220;%d/%m/%Y&#8221;) as `Date Start` , date_format(dt_end, &#8220;%d/%m/%Y&#8221;) as `Date End` , `repeat` as `rpt` FROM smsschedule</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.chapter31.com/2008/10/27/fun-with-reserved-words-in-mysql-5/comment-page-1/#comment-85489</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 17 Dec 2008 12:07:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/?p=476#comment-85489</guid>
		<description>I&#039;ve just had a similar problem. A site which has been working fine for years. I was doing some updates and started getting errors in my MySql query. Navicat showed the field name in blue and that&#039;s what triggered me to this word being a reserved word. My site does vacation rental properties and as part of that, if you&#039;ve got children you might order a &#039;cot&#039;. That&#039;s on one of the forms as a field. Mysql seems to be confusing &#039;cot&#039; with &#039;cotangent&#039;. Been working for years though before now. I&#039;ll try the backticks and see how that goes. Thanks for the heads-up</description>
		<content:encoded><![CDATA[<p>I&#8217;ve just had a similar problem. A site which has been working fine for years. I was doing some updates and started getting errors in my MySql query. Navicat showed the field name in blue and that&#8217;s what triggered me to this word being a reserved word. My site does vacation rental properties and as part of that, if you&#8217;ve got children you might order a &#8216;cot&#8217;. That&#8217;s on one of the forms as a field. Mysql seems to be confusing &#8216;cot&#8217; with &#8216;cotangent&#8217;. Been working for years though before now. I&#8217;ll try the backticks and see how that goes. Thanks for the heads-up</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: radek</title>
		<link>http://www.chapter31.com/2008/10/27/fun-with-reserved-words-in-mysql-5/comment-page-1/#comment-79039</link>
		<dc:creator>radek</dc:creator>
		<pubDate>Tue, 28 Oct 2008 15:18:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/?p=476#comment-79039</guid>
		<description>should be &quot; you may not want to change your code &quot;</description>
		<content:encoded><![CDATA[<p>should be &#8221; you may not want to change your code &#8220;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: radek</title>
		<link>http://www.chapter31.com/2008/10/27/fun-with-reserved-words-in-mysql-5/comment-page-1/#comment-79038</link>
		<dc:creator>radek</dc:creator>
		<pubDate>Tue, 28 Oct 2008 15:17:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/?p=476#comment-79038</guid>
		<description>I think the idea behind it is backwards / cross system compat. If you migrate your app from other DBMS / legacy programming languge you may not change your code.</description>
		<content:encoded><![CDATA[<p>I think the idea behind it is backwards / cross system compat. If you migrate your app from other DBMS / legacy programming languge you may not change your code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Sharman</title>
		<link>http://www.chapter31.com/2008/10/27/fun-with-reserved-words-in-mysql-5/comment-page-1/#comment-79001</link>
		<dc:creator>Michael Sharman</dc:creator>
		<pubDate>Tue, 28 Oct 2008 08:56:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/?p=476#comment-79001</guid>
		<description>@radek, whilst technically this is true I&#039;d argue the logic of ever knowingly using reserved words. It just seems like heading down a path of more trouble particularly in multi-developer environments.

It might not seem like trouble, after all what is a pair of square brackets/back ticks etc? But each and every developer who works on the project has to know and understand that you need to escape the table (or column) name. I&#039;d bet that this would cause unnecessary headache for some like it did me today!</description>
		<content:encoded><![CDATA[<p>@radek, whilst technically this is true I&#8217;d argue the logic of ever knowingly using reserved words. It just seems like heading down a path of more trouble particularly in multi-developer environments.</p>
<p>It might not seem like trouble, after all what is a pair of square brackets/back ticks etc? But each and every developer who works on the project has to know and understand that you need to escape the table (or column) name. I&#8217;d bet that this would cause unnecessary headache for some like it did me today!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: radek</title>
		<link>http://www.chapter31.com/2008/10/27/fun-with-reserved-words-in-mysql-5/comment-page-1/#comment-78998</link>
		<dc:creator>radek</dc:creator>
		<pubDate>Tue, 28 Oct 2008 08:34:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/?p=476#comment-78998</guid>
		<description>in all databases you can name tables and columns with names being keywords. That is why there are characters to escape them. In mysql these are back quotes, in mssql [] and afair &quot;&quot; for names with spaces</description>
		<content:encoded><![CDATA[<p>in all databases you can name tables and columns with names being keywords. That is why there are characters to escape them. In mysql these are back quotes, in mssql [] and afair &#8220;&#8221; for names with spaces</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Goosman</title>
		<link>http://www.chapter31.com/2008/10/27/fun-with-reserved-words-in-mysql-5/comment-page-1/#comment-78965</link>
		<dc:creator>Ben Goosman</dc:creator>
		<pubDate>Tue, 28 Oct 2008 02:27:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/?p=476#comment-78965</guid>
		<description>I meant back tick marks.  Sorry for the confusion.</description>
		<content:encoded><![CDATA[<p>I meant back tick marks.  Sorry for the confusion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Sharman</title>
		<link>http://www.chapter31.com/2008/10/27/fun-with-reserved-words-in-mysql-5/comment-page-1/#comment-78964</link>
		<dc:creator>Michael Sharman</dc:creator>
		<pubDate>Tue, 28 Oct 2008 02:15:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/?p=476#comment-78964</guid>
		<description>@Ben, tick marks (back tick) or quotes? Quotes won&#039;t work as you&#039;ll just return the string that was in quotes. So if I do:

SELECT &#039;repeat&#039;
FROM mytable

I will get &#039;repeat&#039; back. Same with double quotes.

I assume you mean back ticks (`) which do work, but not really very friendly! 

Still, a good solution if you aren&#039;t able to rename your database column. Thanks for that.

I wonder if it&#039;s considered a &quot;bug&quot; if MySQL actually lets you name a column with a reserved word in the first place.</description>
		<content:encoded><![CDATA[<p>@Ben, tick marks (back tick) or quotes? Quotes won&#8217;t work as you&#8217;ll just return the string that was in quotes. So if I do:</p>
<p>SELECT &#8216;repeat&#8217;<br />
FROM mytable</p>
<p>I will get &#8216;repeat&#8217; back. Same with double quotes.</p>
<p>I assume you mean back ticks (`) which do work, but not really very friendly! </p>
<p>Still, a good solution if you aren&#8217;t able to rename your database column. Thanks for that.</p>
<p>I wonder if it&#8217;s considered a &#8220;bug&#8221; if MySQL actually lets you name a column with a reserved word in the first place.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Goosman</title>
		<link>http://www.chapter31.com/2008/10/27/fun-with-reserved-words-in-mysql-5/comment-page-1/#comment-78963</link>
		<dc:creator>Ben Goosman</dc:creator>
		<pubDate>Tue, 28 Oct 2008 02:03:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/?p=476#comment-78963</guid>
		<description>Tick marks should bypass the reserved word filter. e.g. `repeat`</description>
		<content:encoded><![CDATA[<p>Tick marks should bypass the reserved word filter. e.g. `repeat`</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Sharman</title>
		<link>http://www.chapter31.com/2008/10/27/fun-with-reserved-words-in-mysql-5/comment-page-1/#comment-78949</link>
		<dc:creator>Michael Sharman</dc:creator>
		<pubDate>Tue, 28 Oct 2008 00:08:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/?p=476#comment-78949</guid>
		<description>@Chris, thanks Chris. I forgot to mention that I tried adding square brackets as well as a column alias but neither worked.

I had to rename the column.</description>
		<content:encoded><![CDATA[<p>@Chris, thanks Chris. I forgot to mention that I tried adding square brackets as well as a column alias but neither worked.</p>
<p>I had to rename the column.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: chapter31.nfshost.com @ 2012-02-09 08:27:13 -->
