<?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>The Rambling Chronicles: Notes &#187; sql</title>
	<atom:link href="http://notes.theramblingchronicles.co.uk/tags/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://notes.theramblingchronicles.co.uk</link>
	<description>Making sense is optional</description>
	<lastBuildDate>Thu, 26 Aug 2010 10:09:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>MySQL string replace</title>
		<link>http://notes.theramblingchronicles.co.uk/2010/03/23/mysql-string-replace/</link>
		<comments>http://notes.theramblingchronicles.co.uk/2010/03/23/mysql-string-replace/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 12:04:23 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[stuff]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://notes.theramblingchronicles.co.uk/2010/03/23/mysql-string-replace/</guid>
		<description><![CDATA[Keep forgetting this. Replace a string in all rows: UPDATE &#60;table&#62; SET &#60;column&#62; = REPLACE&#40;&#60;column&#62;, '&#60;string to find&#62;', '&#60;string to replace&#62;'&#41;;]]></description>
			<content:encoded><![CDATA[<p>Keep forgetting this. Replace a string in all rows:</p>


<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> <span style="color: #66cc66;">&lt;</span>table<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #66cc66;">&lt;</span>column<span style="color: #66cc66;">&gt;</span> <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&lt;</span>column<span style="color: #66cc66;">&gt;,</span> <span style="color: #ff0000;">'&lt;string to find&gt;'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'&lt;string to replace&gt;'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>
]]></content:encoded>
			<wfw:commentRss>http://notes.theramblingchronicles.co.uk/2010/03/23/mysql-string-replace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL reset auto_increment</title>
		<link>http://notes.theramblingchronicles.co.uk/2009/09/06/mysql-reset-auto_increment/</link>
		<comments>http://notes.theramblingchronicles.co.uk/2009/09/06/mysql-reset-auto_increment/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 15:52:09 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[stuff]]></category>
		<category><![CDATA[auto_increment]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://theramblingchronicles.co.uk/2009/09/06/mysql-reset-auto_increment/</guid>
		<description><![CDATA[Because I keep forgetting it: ALTER TABLE the_table AUTO_INCREMENT= 0]]></description>
			<content:encoded><![CDATA[<p>Because I keep forgetting it: <code>ALTER TABLE the_table AUTO_INCREMENT= 0</code></p>]]></content:encoded>
			<wfw:commentRss>http://notes.theramblingchronicles.co.uk/2009/09/06/mysql-reset-auto_increment/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>import CSV into MySQL</title>
		<link>http://notes.theramblingchronicles.co.uk/2009/09/05/import-csv-into-mysql/</link>
		<comments>http://notes.theramblingchronicles.co.uk/2009/09/05/import-csv-into-mysql/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 20:22:06 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[stuff]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://theramblingchronicles.co.uk/2009/09/05/import-csv-into-mysql/</guid>
		<description><![CDATA[Run from mysql program with FILE privileges or it won&#8217;t work. LOAD DATA LOCAL INFILE '/importfile.csv' INTO TABLE test_table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' &#40;field1, filed2, field3&#41;; Note: Path needs to be absolute]]></description>
			<content:encoded><![CDATA[<p>Run from <code>mysql</code> program with <span class="caps">FILE </span>privileges or it won&#8217;t work.</p>


<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">LOAD</span> <span style="color: #993333; font-weight: bold;">DATA</span> <span style="color: #993333; font-weight: bold;">LOCAL</span> <span style="color: #993333; font-weight: bold;">INFILE</span> <span style="color: #ff0000;">'/importfile.csv'</span>
<span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #993333; font-weight: bold;">TABLE</span> test_table
<span style="color: #993333; font-weight: bold;">FIELDS</span> TERMINATED <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">','</span>
<span style="color: #993333; font-weight: bold;">LINES</span> TERMINATED <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span>
<span style="color: #66cc66;">&#40;</span>field1<span style="color: #66cc66;">,</span> filed2<span style="color: #66cc66;">,</span> field3<span style="color: #66cc66;">&#41;</span>;</pre></div></div>




<p><strong>Note:</strong> Path needs to be absolute</p>]]></content:encoded>
			<wfw:commentRss>http://notes.theramblingchronicles.co.uk/2009/09/05/import-csv-into-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
