<?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>uRaNGaTaNG &#187; mysql</title>
	<atom:link href="http://www.rngtng.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rngtng.com</link>
	<description>TobiTobes Tech Weblog featuring Ruby, Rails, Web development, Arduino, Processing, Geekstuff and more...</description>
	<lastBuildDate>Thu, 01 Jul 2010 11:36:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>MySQL: How to swap entires of two columns with just one query</title>
		<link>http://www.rngtng.com/2009/06/24/mysql-how-to-swap-entires-of-two-columns-with-just-one-query/</link>
		<comments>http://www.rngtng.com/2009/06/24/mysql-how-to-swap-entires-of-two-columns-with-just-one-query/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 13:16:29 +0000</pubDate>
		<dc:creator>tobi</dc:creator>
				<category><![CDATA[Happy Hacking]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[swap]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[values]]></category>

		<guid isPermaLink="false">http://www.rngtng.com/?p=134</guid>
		<description><![CDATA[Check this out, I found out a really nice way how to swap values of two columns with just one query, using user defined variables. Given a table with two columns a and b. To swap their values in whole, use this query: UPDATE my_table SET a=@tmp:=a, a=b, b=@tmp; Done! Isn&#8217;t that easy?]]></description>
			<content:encoded><![CDATA[<p>Check this out, I found out a really nice way how to swap values of two columns with just one query, <a href="http://www.rngtng.com/2009/04/02/mysql-user-defined-variables-good-thing-to-know/">using user defined variables</a>. Given a table with two columns <em>a</em> and  <em>b</em>. To swap their values in whole, use this query:</p>
<pre class="brush: plain;">
UPDATE my_table SET a=@tmp:=a, a=b, b=@tmp;
</pre>
<p>Done! Isn&#8217;t that easy?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rngtng.com/2009/06/24/mysql-how-to-swap-entires-of-two-columns-with-just-one-query/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL User defined Variables &#8211; good thing to know!</title>
		<link>http://www.rngtng.com/2009/04/02/mysql-user-defined-variables-good-thing-to-know/</link>
		<comments>http://www.rngtng.com/2009/04/02/mysql-user-defined-variables-good-thing-to-know/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 12:59:54 +0000</pubDate>
		<dc:creator>tobi</dc:creator>
				<category><![CDATA[Happy Hacking]]></category>
		<category><![CDATA[hint]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[user defined]]></category>
		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://www.rngtng.com/?p=121</guid>
		<description><![CDATA[Have you ever heard of user defined variables in MySQL? I hadn&#8217;t and nearly freaked out when I found out. That&#8217;s the thing I was always looking for, that&#8217;s so cool, and fasten up your SQL live a lot! Now, renumbering a table is as easy as never before: Set @a = 0; UPDATE my_table [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-bottom:20px"><img class="alignright" style="margin: 18px" src="http://matsu.files.wordpress.com/2008/01/mysql-logo.png" alt="" width="140" height="72" /> Have you ever heard of user defined variables in MySQL? I hadn&#8217;t and nearly freaked out when I found out. That&#8217;s the thing I was always looking for, that&#8217;s so cool, and fasten up your SQL live a lot!</p>
<p style="text-align: left">Now, renumbering a table is as easy as never before:</p>
<pre class="brush: plain;">
Set @a = 0;
UPDATE my_table SET id=@a:=@a+1
</pre>
<p>Check out the docu and examples:</p>
<p><a href="http://dev.mysql.com/doc/refman/5.0/en/user-variables.html" target="_blank">http://dev.mysql.com/doc/refman/5.0/en/user-variables.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rngtng.com/2009/04/02/mysql-user-defined-variables-good-thing-to-know/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
