<?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>Helyar.net &#187; sql</title>
	<atom:link href="http://www.helyar.net/tag/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.helyar.net</link>
	<description>From the desktop of George Helyar</description>
	<lastBuildDate>Thu, 26 Jan 2012 16:11:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Stop saying SEQUEL</title>
		<link>http://www.helyar.net/2011/stop-saying-sequel/</link>
		<comments>http://www.helyar.net/2011/stop-saying-sequel/#comments</comments>
		<pubDate>Sat, 02 Jul 2011 12:47:51 +0000</pubDate>
		<dc:creator>George Helyar</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.helyar.net/?p=633</guid>
		<description><![CDATA[SQL is not the same thing as SEQUEL. If you&#8217;re a grumpy old DBA, stuck in your ways, who actually used SEQUEL back in the 1970s, that&#8217;s fine. For all the new kids just getting into SQL, it&#8217;s pronounced es-que-el, not sequel. When you call it sequel, you sound like just as much of an [...]]]></description>
			<content:encoded><![CDATA[<p>SQL is not the same thing as SEQUEL. If you&#8217;re a grumpy old DBA, stuck in your ways, who actually used SEQUEL back in the 1970s, that&#8217;s fine. For all the new kids just getting into SQL, it&#8217;s pronounced es-que-el, not sequel. When you call it sequel, you sound like just as much of an idiot as someone who says lynuks. It&#8217;s annoying.</p>
<p>The &#8220;SQL&#8221; pronunciation is actually defined in the original 1986 specification for SQL and confirmed by common DBMS such as <a href="http://dev.mysql.com/doc/refman/5.0/en/what-is-mysql.html">MySQL</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.helyar.net/2011/stop-saying-sequel/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Moving comments in WordPress</title>
		<link>http://www.helyar.net/2010/moving-comments-in-wordpress/</link>
		<comments>http://www.helyar.net/2010/moving-comments-in-wordpress/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 15:03:02 +0000</pubDate>
		<dc:creator>George Helyar</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.helyar.net/?p=440</guid>
		<description><![CDATA[In MySQL, first move the comment: UPDATE wp_comments SET comment_post_ID = P_TO_ID WHERE comment_ID = C_ID; P_TO_ID is the ID of the post you are moving it to. C_ID is the ID of the comment you are moving. You can find both of these IDs easily from the dashboard. Then correct the comment counts for [...]]]></description>
			<content:encoded><![CDATA[<p>In MySQL, first move the comment:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;color: black;"><span style="color: #993333; font-weight: bold;color: blue;">UPDATE</span> wp_comments <span style="color: #993333; font-weight: bold;color: blue;">SET</span> comment_post_ID <span style="color: #66cc66;color: black;">=</span> P_TO_ID <span style="color: #993333; font-weight: bold;color: blue;">WHERE</span> comment_ID <span style="color: #66cc66;color: black;">=</span> C_ID;</pre></div></div>

<p>P_TO_ID is the ID of the post you are moving it to. C_ID is the ID of the comment you are moving. You can find both of these IDs easily from the dashboard.</p>
<p>Then correct the comment counts for the posts:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;color: black;"><span style="color: #993333; font-weight: bold;color: blue;">UPDATE</span> wp_posts <span style="color: #993333; font-weight: bold;color: blue;">SET</span> comment_count <span style="color: #66cc66;color: black;">=</span> <span style="color: #66cc66;color: black;">&#40;</span><span style="color: #993333; font-weight: bold;color: blue;">SELECT</span> <span style="color: #993333; font-weight: bold;color: blue;">COUNT</span><span style="color: #66cc66;color: black;">&#40;</span><span style="color: #66cc66;color: black;">*</span><span style="color: #66cc66;color: black;">&#41;</span> <span style="color: #993333; font-weight: bold;color: blue;">FROM</span> wp_comments <span style="color: #993333; font-weight: bold;color: blue;">WHERE</span> comment_post_id <span style="color: #66cc66;color: black;">=</span> id <span style="color: #993333; font-weight: bold;color: blue;">AND</span> comment_approved <span style="color: #66cc66;color: black;">=</span> <span style="color: #cc66cc;color: maroon;">1</span><span style="color: #66cc66;color: black;">&#41;</span>
<span style="color: #993333; font-weight: bold;color: blue;">WHERE</span> comment_count !<span style="color: #66cc66;color: black;">=</span> <span style="color: #66cc66;color: black;">&#40;</span><span style="color: #993333; font-weight: bold;color: blue;">SELECT</span> <span style="color: #993333; font-weight: bold;color: blue;">COUNT</span><span style="color: #66cc66;color: black;">&#40;</span><span style="color: #66cc66;color: black;">*</span><span style="color: #66cc66;color: black;">&#41;</span> <span style="color: #993333; font-weight: bold;color: blue;">FROM</span> wp_comments <span style="color: #993333; font-weight: bold;color: blue;">WHERE</span> comment_post_id <span style="color: #66cc66;color: black;">=</span> id <span style="color: #993333; font-weight: bold;color: blue;">AND</span> comment_approved <span style="color: #66cc66;color: black;">=</span> <span style="color: #cc66cc;color: maroon;">1</span><span style="color: #66cc66;color: black;">&#41;</span>;</pre></div></div>

<p>The second line in this query is not strictly necessary but it lets you know how many posts were affected.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.helyar.net/2010/moving-comments-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

