<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Update Multiple Rows With Different Values and a Single SQL Query</title>
	<atom:link href="http://www.karlrixon.co.uk/writing/update-multiple-rows-with-different-values-and-a-single-sql-query/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.karlrixon.co.uk/writing/update-multiple-rows-with-different-values-and-a-single-sql-query/</link>
	<description>Web development, programming and I.T.</description>
	<lastBuildDate>Wed, 02 May 2012 15:54:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Mike</title>
		<link>http://www.karlrixon.co.uk/writing/update-multiple-rows-with-different-values-and-a-single-sql-query/comment-page-2/#comment-32888</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Thu, 26 Apr 2012 07:13:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.karlrixon.co.uk/?p=51#comment-32888</guid>
		<description>I just bundle all the update queries into a transaction and run that. That only sends one request to the datatabase. That way I can update multiple values in the same SQL query. Can your method only update one parameter in the query at a time?</description>
		<content:encoded><![CDATA[<p>I just bundle all the update queries into a transaction and run that. That only sends one request to the datatabase. That way I can update multiple values in the same SQL query. Can your method only update one parameter in the query at a time?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: putude</title>
		<link>http://www.karlrixon.co.uk/writing/update-multiple-rows-with-different-values-and-a-single-sql-query/comment-page-2/#comment-32576</link>
		<dc:creator>putude</dc:creator>
		<pubDate>Wed, 18 Apr 2012 07:40:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.karlrixon.co.uk/?p=51#comment-32576</guid>
		<description>This trick is very helpful. Save time and resource. Thank you for sharing.</description>
		<content:encoded><![CDATA[<p>This trick is very helpful. Save time and resource. Thank you for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vyshak</title>
		<link>http://www.karlrixon.co.uk/writing/update-multiple-rows-with-different-values-and-a-single-sql-query/comment-page-2/#comment-32411</link>
		<dc:creator>Vyshak</dc:creator>
		<pubDate>Sat, 14 Apr 2012 06:52:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.karlrixon.co.uk/?p=51#comment-32411</guid>
		<description>How can i use this statements to update a emp_Salary with three conditions as follows
1.sal &gt;=2000 and =6000 with 2%
3.sal&lt;2000 with 20%</description>
		<content:encoded><![CDATA[<p>How can i use this statements to update a emp_Salary with three conditions as follows<br />
1.sal &gt;=2000 and =6000 with 2%<br />
3.sal&lt;2000 with 20%</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 10 sql tips to speed up your database &#187; MyWeblog</title>
		<link>http://www.karlrixon.co.uk/writing/update-multiple-rows-with-different-values-and-a-single-sql-query/comment-page-2/#comment-32202</link>
		<dc:creator>10 sql tips to speed up your database &#187; MyWeblog</dc:creator>
		<pubDate>Tue, 10 Apr 2012 02:40:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.karlrixon.co.uk/?p=51#comment-32202</guid>
		<description>[...] Source: http://www.karlrixon.co.uk/articles/sql/update-multiple-rows-with-different-values-and-a-single-sql-... [...]</description>
		<content:encoded><![CDATA[<p>[...] Source: http://www.karlrixon.co.uk/articles/sql/update-multiple-rows-with-different-values-and-a-single-sql-&#8230; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guilherme</title>
		<link>http://www.karlrixon.co.uk/writing/update-multiple-rows-with-different-values-and-a-single-sql-query/comment-page-2/#comment-29997</link>
		<dc:creator>Guilherme</dc:creator>
		<pubDate>Sun, 19 Feb 2012 01:39:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.karlrixon.co.uk/?p=51#comment-29997</guid>
		<description>Thanks very much. This helped me alot.</description>
		<content:encoded><![CDATA[<p>Thanks very much. This helped me alot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://www.karlrixon.co.uk/writing/update-multiple-rows-with-different-values-and-a-single-sql-query/comment-page-2/#comment-29082</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Wed, 01 Feb 2012 14:54:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.karlrixon.co.uk/?p=51#comment-29082</guid>
		<description>Hi,
Thanks for this, it helped a lot.

I would have one remark/question though. I tested it with and without the WHERE clause. And when tested without the clause, all entries not concerned by the WHEN clause were set to null.
To fix this, I had to add a &quot;else display_order&quot; to the query.
Didn&#039;t you come accross this?
Thanks again!</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Thanks for this, it helped a lot.</p>
<p>I would have one remark/question though. I tested it with and without the WHERE clause. And when tested without the clause, all entries not concerned by the WHEN clause were set to null.<br />
To fix this, I had to add a &#8220;else display_order&#8221; to the query.<br />
Didn&#8217;t you come accross this?<br />
Thanks again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jocsism</title>
		<link>http://www.karlrixon.co.uk/writing/update-multiple-rows-with-different-values-and-a-single-sql-query/comment-page-2/#comment-28247</link>
		<dc:creator>Jocsism</dc:creator>
		<pubDate>Mon, 16 Jan 2012 20:43:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.karlrixon.co.uk/?p=51#comment-28247</guid>
		<description>Good one sir this is what i&#039;m looking for thanks! sir is it possible to use column increments like display_order=display_order+1 based on your example, because in my case im trying to update the quantity of the inventory based on their status. like for example i updated a certain item to status &#039;InStock&#039; i would also like my table inventory column &#039;InStock&#039; value to increment . i would appreciate it very much if you email me regarding this question. thank you.</description>
		<content:encoded><![CDATA[<p>Good one sir this is what i&#8217;m looking for thanks! sir is it possible to use column increments like display_order=display_order+1 based on your example, because in my case im trying to update the quantity of the inventory based on their status. like for example i updated a certain item to status &#8216;InStock&#8217; i would also like my table inventory column &#8216;InStock&#8217; value to increment . i would appreciate it very much if you email me regarding this question. thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Efficient Update SQL, updating multiple rows with one SQL statement, Avoiding Loops &#124; DIGG LINK</title>
		<link>http://www.karlrixon.co.uk/writing/update-multiple-rows-with-different-values-and-a-single-sql-query/comment-page-2/#comment-27870</link>
		<dc:creator>Efficient Update SQL, updating multiple rows with one SQL statement, Avoiding Loops &#124; DIGG LINK</dc:creator>
		<pubDate>Mon, 09 Jan 2012 11:18:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.karlrixon.co.uk/?p=51#comment-27870</guid>
		<description>[...] http://www.karlrixon.co.uk/writing/update-multiple-rows-with-different-values-and-a-single-sql-query... [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://www.karlrixon.co.uk/writing/update-multiple-rows-with-different-values-and-a-single-sql-query" rel="nofollow">http://www.karlrixon.co.uk/writing/update-multiple-rows-with-different-values-and-a-single-sql-query</a>&#8230; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pradeep Kumar Sharma (http://www.techtt.org)</title>
		<link>http://www.karlrixon.co.uk/writing/update-multiple-rows-with-different-values-and-a-single-sql-query/comment-page-2/#comment-26826</link>
		<dc:creator>Pradeep Kumar Sharma (http://www.techtt.org)</dc:creator>
		<pubDate>Fri, 23 Dec 2011 07:26:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.karlrixon.co.uk/?p=51#comment-26826</guid>
		<description>it should be like

 UPDATE empsal SET sal =
    CASE WHEN sal BETWEEN 100 AND 500 THEN sal + 5000
    WHEN sal BETWEEN 40000 AND 55000 THEN sal + 7000
   else sal

    END</description>
		<content:encoded><![CDATA[<p>it should be like</p>
<p> UPDATE empsal SET sal =<br />
    CASE WHEN sal BETWEEN 100 AND 500 THEN sal + 5000<br />
    WHEN sal BETWEEN 40000 AND 55000 THEN sal + 7000<br />
   else sal</p>
<p>    END</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eilo</title>
		<link>http://www.karlrixon.co.uk/writing/update-multiple-rows-with-different-values-and-a-single-sql-query/comment-page-2/#comment-26659</link>
		<dc:creator>Eilo</dc:creator>
		<pubDate>Wed, 21 Dec 2011 04:05:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.karlrixon.co.uk/?p=51#comment-26659</guid>
		<description>This was the most amazing tip on sql ever!!

I was able to solve a 2963 + 1520 duplicated rows (from 2 different dbs) with a single query..... obviously i made a table_copy and use the same method to achieve the goal.

UPDATE characters AS t, (SELECT `guid`,`name` FROM `characters_copy` GROUP BY `name` HAVING COUNT(`name`)=2) AS n SET t.`name`=CONCAT(t.`name`,&#039;aaa&#039;) WHERE t.guid=n.guid;

Thank you so much!</description>
		<content:encoded><![CDATA[<p>This was the most amazing tip on sql ever!!</p>
<p>I was able to solve a 2963 + 1520 duplicated rows (from 2 different dbs) with a single query&#8230;.. obviously i made a table_copy and use the same method to achieve the goal.</p>
<p>UPDATE characters AS t, (SELECT `guid`,`name` FROM `characters_copy` GROUP BY `name` HAVING COUNT(`name`)=2) AS n SET t.`name`=CONCAT(t.`name`,&#8217;aaa&#8217;) WHERE t.guid=n.guid;</p>
<p>Thank you so much!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

