<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Solution of Puzzle &#8211; Swap Value of Column Without Case Statement</title>
	<atom:link href="http://blog.sqlauthority.com/2012/06/14/sql-server-solution-of-puzzle-swap-value-of-column-without-case-statement/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2012/06/14/sql-server-solution-of-puzzle-swap-value-of-column-without-case-statement/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 17 May 2013 15:26:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: SQL SERVER &#8211; Simple Explanation and Puzzle with SOUNDEX Function and DIFFERENCE Function &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2012/06/14/sql-server-solution-of-puzzle-swap-value-of-column-without-case-statement/#comment-301862</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Simple Explanation and Puzzle with SOUNDEX Function and DIFFERENCE Function &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 16 Jun 2012 01:31:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=19357#comment-301862</guid>
		<description><![CDATA[[...] Earlier this week I asked a question where I asked how to Swap Values of the column without using CASE Statement. Read here: A Puzzle – Swap Value of Column Without Case Statement,there were more than 50 solutions proposed in the comment. There were many creative solutions. I have mentioned my personal favorite (different ones) here: Solution of Puzzle – Swap Value of Column Without Case Statement. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Earlier this week I asked a question where I asked how to Swap Values of the column without using CASE Statement. Read here: A Puzzle – Swap Value of Column Without Case Statement,there were more than 50 solutions proposed in the comment. There were many creative solutions. I have mentioned my personal favorite (different ones) here: Solution of Puzzle – Swap Value of Column Without Case Statement. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: harshcontractor</title>
		<link>http://blog.sqlauthority.com/2012/06/14/sql-server-solution-of-puzzle-swap-value-of-column-without-case-statement/#comment-301715</link>
		<dc:creator><![CDATA[harshcontractor]]></dc:creator>
		<pubDate>Fri, 15 Jun 2012 16:15:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=19357#comment-301715</guid>
		<description><![CDATA[Thanks Raji P Thomas for selecting my solution .

I have another simple solution.

UPDATE SimpleTable
SET Gender = LTRIM(REPLACE(&#039; male female&#039;,&#039; &#039; +Gender,&#039;&#039;))
GO]]></description>
		<content:encoded><![CDATA[<p>Thanks Raji P Thomas for selecting my solution .</p>
<p>I have another simple solution.</p>
<p>UPDATE SimpleTable<br />
SET Gender = LTRIM(REPLACE(&#8216; male female&#8217;,&#8217; &#8216; +Gender,&#8221;))<br />
GO</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nikhildas</title>
		<link>http://blog.sqlauthority.com/2012/06/14/sql-server-solution-of-puzzle-swap-value-of-column-without-case-statement/#comment-301533</link>
		<dc:creator><![CDATA[Nikhildas]]></dc:creator>
		<pubDate>Fri, 15 Jun 2012 04:20:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=19357#comment-301533</guid>
		<description><![CDATA[Hai Pinal,


Really i inspired by myself bcoz of one solution among the five is mine.

I personally like the solution by SIJIN KUMAR V P

By using COALESCE() and NULLIF()

UPDATE SimpleTable
SET Gender = COALESCE(NULLIF(‘female’,Gender), ‘male’)


Thanks,
Nikhildas
Cochin]]></description>
		<content:encoded><![CDATA[<p>Hai Pinal,</p>
<p>Really i inspired by myself bcoz of one solution among the five is mine.</p>
<p>I personally like the solution by SIJIN KUMAR V P</p>
<p>By using COALESCE() and NULLIF()</p>
<p>UPDATE SimpleTable<br />
SET Gender = COALESCE(NULLIF(‘female’,Gender), ‘male’)</p>
<p>Thanks,<br />
Nikhildas<br />
Cochin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EscrimaRyan</title>
		<link>http://blog.sqlauthority.com/2012/06/14/sql-server-solution-of-puzzle-swap-value-of-column-without-case-statement/#comment-301251</link>
		<dc:creator><![CDATA[EscrimaRyan]]></dc:creator>
		<pubDate>Thu, 14 Jun 2012 14:07:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=19357#comment-301251</guid>
		<description><![CDATA[update SimpleTable
set Gender = coalesce(nullif(&#039;male&#039;, Gender), nullif(&#039;female&#039;, Gender))]]></description>
		<content:encoded><![CDATA[<p>update SimpleTable<br />
set Gender = coalesce(nullif(&#8216;male&#8217;, Gender), nullif(&#8216;female&#8217;, Gender))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SIJIN KUMAR V P</title>
		<link>http://blog.sqlauthority.com/2012/06/14/sql-server-solution-of-puzzle-swap-value-of-column-without-case-statement/#comment-301151</link>
		<dc:creator><![CDATA[SIJIN KUMAR V P]]></dc:creator>
		<pubDate>Thu, 14 Jun 2012 11:17:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=19357#comment-301151</guid>
		<description><![CDATA[Thank you all.
I like the Solution by Roji P Thomas
Its a general one and works for any values.

UPDATE S
SET S.Gender = D.Gender
FROM SimpleTable S
INNER JOIN SimpleTable D
ON S.Gender != D.Gender

Once again thank you so much Pinal for the excellent Puzzle that added a lot to my knowledge.]]></description>
		<content:encoded><![CDATA[<p>Thank you all.<br />
I like the Solution by Roji P Thomas<br />
Its a general one and works for any values.</p>
<p>UPDATE S<br />
SET S.Gender = D.Gender<br />
FROM SimpleTable S<br />
INNER JOIN SimpleTable D<br />
ON S.Gender != D.Gender</p>
<p>Once again thank you so much Pinal for the excellent Puzzle that added a lot to my knowledge.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2012/06/14/sql-server-solution-of-puzzle-swap-value-of-column-without-case-statement/#comment-301110</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Thu, 14 Jun 2012 10:03:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=19357#comment-301110</guid>
		<description><![CDATA[Roji P Thomas,

Great comment as usual. However, I must acknowledge that your comments are indeed the first one to start the great conversation.]]></description>
		<content:encoded><![CDATA[<p>Roji P Thomas,</p>
<p>Great comment as usual. However, I must acknowledge that your comments are indeed the first one to start the great conversation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roji P Thomas</title>
		<link>http://blog.sqlauthority.com/2012/06/14/sql-server-solution-of-puzzle-swap-value-of-column-without-case-statement/#comment-300992</link>
		<dc:creator><![CDATA[Roji P Thomas]]></dc:creator>
		<pubDate>Thu, 14 Jun 2012 02:43:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=19357#comment-300992</guid>
		<description><![CDATA[To be clear, I will NOT use any of my solutions if I have to really use it in Production code. I will either use the good old CASE or IIF. 

And the solutions I like from the comments are

UPDATE SimpleTable
 SET Gender = COALESCE(NULLIF(‘female’,Gender), ‘male’)

UPDATE SimpleTable
 SET Gender = RIGHT(‘female’, 10 – LEN(Gender))]]></description>
		<content:encoded><![CDATA[<p>To be clear, I will NOT use any of my solutions if I have to really use it in Production code. I will either use the good old CASE or IIF. </p>
<p>And the solutions I like from the comments are</p>
<p>UPDATE SimpleTable<br />
 SET Gender = COALESCE(NULLIF(‘female’,Gender), ‘male’)</p>
<p>UPDATE SimpleTable<br />
 SET Gender = RIGHT(‘female’, 10 – LEN(Gender))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sathyanarayanansrinivasan</title>
		<link>http://blog.sqlauthority.com/2012/06/14/sql-server-solution-of-puzzle-swap-value-of-column-without-case-statement/#comment-300987</link>
		<dc:creator><![CDATA[sathyanarayanansrinivasan]]></dc:creator>
		<pubDate>Thu, 14 Jun 2012 02:21:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=19357#comment-300987</guid>
		<description><![CDATA[I have never used that soundex function, as you said that was an excellent way of thinking I have never thought so Pinal.. Superb Sijin...]]></description>
		<content:encoded><![CDATA[<p>I have never used that soundex function, as you said that was an excellent way of thinking I have never thought so Pinal.. Superb Sijin&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
