<?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>SysAdmin Valley &#187; SQL</title>
	<atom:link href="http://www.sysadminvalley.com/tag/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sysadminvalley.com</link>
	<description>I might as well write this stuff down so I remember it tomorrow</description>
	<lastBuildDate>Wed, 25 Jan 2012 15:06:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Search and Replace in MySQL</title>
		<link>http://www.sysadminvalley.com/2010/05/18/search-and-replace-in-mysql/</link>
		<comments>http://www.sysadminvalley.com/2010/05/18/search-and-replace-in-mysql/#comments</comments>
		<pubDate>Tue, 18 May 2010 12:59:51 +0000</pubDate>
		<dc:creator>mshields</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.sysadminvalley.com/?p=229</guid>
		<description><![CDATA[I do a lot of work with MySQL and I&#8217;ve had this reoccuring problem were I need to find some text in a table and replace it with new text. Like say I have a table of data that talks about dogs and I want to replace every occurrence of dog with cat. The old [...]]]></description>
			<content:encoded><![CDATA[<p>I do a lot of work with <a target="_blank" href="http://www.beantownsoftware.com/shop/search.html?keyword=mysql">MySQL</a> and I&#8217;ve had this reoccuring problem were I need to find some text in a table and replace it with new text.  Like say I have a table of data that talks about dogs and I want to replace every occurrence of dog with cat.  The old way I would search the entire table to find all rows that have the word dog in it, then that would give me a list to manually update each row.  I&#8217;d then rerun the query to see if I missed any.</p>
<p>Recently I found that <a target="_blank" href="http://www.beantownsoftware.com/shop/search.html?keyword=mysql">MySQL</a> supports a command called what else but &#8220;replace&#8221;.  So let&#8217;s say I have a table called &#8220;news&#8221; and in the table is a column called &#8220;content&#8221; and I wanted to replace all references of &#8220;dog&#8221; with &#8220;cat&#8221;, here is an example query.</p>
<blockquote><p>update news set content = replace(content, &#8220;dog&#8221;, &#8220;cat&#8221;);</p></blockquote>
<p>Very simple, it tells <a target="_blank" href="http://www.beantownsoftware.com/shop/search.html?keyword=mysql">MySQL</a> to replace the &#8220;content&#8221; field with what&#8217;s in the &#8220;content&#8221; field but replace &#8220;dog&#8221; with &#8220;cat&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadminvalley.com/2010/05/18/search-and-replace-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Joke</title>
		<link>http://www.sysadminvalley.com/2009/08/16/sql-joke/</link>
		<comments>http://www.sysadminvalley.com/2009/08/16/sql-joke/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 21:04:15 +0000</pubDate>
		<dc:creator>mshields</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[jokes]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.sysadminvalley.com/?p=104</guid>
		<description><![CDATA[A SQL query goes into a bar, walks up to two tables and says, &#8220;Can I join you?&#8221;]]></description>
			<content:encoded><![CDATA[<p>A SQL query goes into a bar, walks up to two tables and says, &#8220;Can I join you?&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadminvalley.com/2009/08/16/sql-joke/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

