<?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>Harry Bailey &#187; MySQL</title>
	<atom:link href="http://harrybailey.com/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://harrybailey.com</link>
	<description>just a little bit geeky</description>
	<lastBuildDate>Tue, 24 Aug 2010 12:15:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MySQL Toggle a Fields Value</title>
		<link>http://harrybailey.com/2010/04/mysql-toggle-a-fields-value/</link>
		<comments>http://harrybailey.com/2010/04/mysql-toggle-a-fields-value/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 15:54:43 +0000</pubDate>
		<dc:creator>Harry</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://harrybailey.com/?p=436</guid>
		<description><![CDATA[
UPDATE `table_name`
SET `field_name` = (SELECT CASE `field_name` WHEN 1 THEN 0 ELSE 1 END)
WHERE `id_column` = 1

Or with text strings

UPDATE `table_name`
SET `field_name` = (SELECT CASE `field_name` WHEN 'foo' THEN 'bar' ELSE 'foo' END)
WHERE `id_column` = 1

]]></description>
			<content:encoded><![CDATA[<pre>
UPDATE `table_name`
SET `field_name` = (SELECT CASE `field_name` WHEN 1 THEN 0 ELSE 1 END)
WHERE `id_column` = 1
</pre>
<p>Or with text strings</p>
<pre>
UPDATE `table_name`
SET `field_name` = (SELECT CASE `field_name` WHEN 'foo' THEN 'bar' ELSE 'foo' END)
WHERE `id_column` = 1
</pre>
]]></content:encoded>
			<wfw:commentRss>http://harrybailey.com/2010/04/mysql-toggle-a-fields-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Multiple Primary Key Columns In A Table</title>
		<link>http://harrybailey.com/2009/05/mysql-multiple-primary-key-columns-in-a-table/</link>
		<comments>http://harrybailey.com/2009/05/mysql-multiple-primary-key-columns-in-a-table/#comments</comments>
		<pubDate>Fri, 01 May 2009 13:46:23 +0000</pubDate>
		<dc:creator>Harry</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://harrybailey.com/?p=280</guid>
		<description><![CDATA[Some database management tools refuse to admit you can add multiple primary key columns to one table, so you might have to do it with direct sql syntax ( deep intake of breath ).
Multiple primary keys make &#8216;ON DUPLICATE KEY UPDATE column = column + 100&#8242; type queries a shed load more flexible.
Anyway, on with [...]]]></description>
			<content:encoded><![CDATA[<p>Some database management tools refuse to admit you can add multiple primary key columns to one table, so you might have to do it with direct sql syntax ( deep intake of breath ).</p>
<p>Multiple primary keys make &#8216;ON DUPLICATE KEY UPDATE column = column + 100&#8242; type queries a shed load more flexible.</p>
<p>Anyway, on with the code:</p>

<div class="wp_syntax"><div class="code"><pre class="sql sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">TABLE</span> tablename <span style="color: #993333; font-weight: bold;">ADD</span> <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #66cc66;">&#40;</span>column_one<span style="color: #66cc66;">,</span> column_two<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>And there you have it. Robert&#8217;s your fathers brother.</p>
]]></content:encoded>
			<wfw:commentRss>http://harrybailey.com/2009/05/mysql-multiple-primary-key-columns-in-a-table/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
