<?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: SQL Version of YesNoFormat</title>
	<atom:link href="http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/</link>
	<description>Anuj @ ColdFusion, Flex and some more....</description>
	<lastBuildDate>Wed, 10 Mar 2010 09:31:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Anuj Gakhar</title>
		<link>http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/comment-page-1/#comment-845</link>
		<dc:creator>Anuj Gakhar</dc:creator>
		<pubDate>Mon, 25 Feb 2008 11:40:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/#comment-845</guid>
		<description>@Marek, I dont think IF is a Sql server function. Looks like a Mysql function to me.</description>
		<content:encoded><![CDATA[<p>@Marek, I dont think IF is a Sql server function. Looks like a Mysql function to me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marek</title>
		<link>http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/comment-page-1/#comment-843</link>
		<dc:creator>Marek</dc:creator>
		<pubDate>Mon, 25 Feb 2008 11:13:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/#comment-843</guid>
		<description>Try this:
SELECT IF(columnName, &#039;Yes&#039;, &#039;No&#039;) as YesNo FROM TableName</description>
		<content:encoded><![CDATA[<p>Try this:<br />
SELECT IF(columnName, &#8216;Yes&#8217;, &#8216;No&#8217;) as YesNo FROM TableName</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Çağlar Gülçehre</title>
		<link>http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/comment-page-1/#comment-700</link>
		<dc:creator>Çağlar Gülçehre</dc:creator>
		<pubDate>Tue, 19 Feb 2008 06:23:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/#comment-700</guid>
		<description>Wow this is a very clever trick.</description>
		<content:encoded><![CDATA[<p>Wow this is a very clever trick.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/comment-page-1/#comment-693</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Mon, 18 Feb 2008 23:31:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/#comment-693</guid>
		<description>For oracle:

select decode(YesNoCol, 1, &#039;Yes&#039;, &#039;No&#039;) from TableName;</description>
		<content:encoded><![CDATA[<p>For oracle:</p>
<p>select decode(YesNoCol, 1, &#8216;Yes&#8217;, &#8216;No&#8217;) from TableName;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anuj Gakhar</title>
		<link>http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/comment-page-1/#comment-684</link>
		<dc:creator>Anuj Gakhar</dc:creator>
		<pubDate>Mon, 18 Feb 2008 15:20:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/#comment-684</guid>
		<description>Well spotted Boyan. Thanks. I have updated it now.</description>
		<content:encoded><![CDATA[<p>Well spotted Boyan. Thanks. I have updated it now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boyan Kostadinov</title>
		<link>http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/comment-page-1/#comment-683</link>
		<dc:creator>Boyan Kostadinov</dc:creator>
		<pubDate>Mon, 18 Feb 2008 15:11:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/#comment-683</guid>
		<description>Neat trick. I know you probably meant to say SUBSTRING(’YesNo’, 1, 3) returns YES but you said returns &#039;NO&#039;.</description>
		<content:encoded><![CDATA[<p>Neat trick. I know you probably meant to say SUBSTRING(’YesNo’, 1, 3) returns YES but you said returns &#8216;NO&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron Stewart</title>
		<link>http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/comment-page-1/#comment-627</link>
		<dc:creator>Ron Stewart</dc:creator>
		<pubDate>Sat, 16 Feb 2008 14:57:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/#comment-627</guid>
		<description>I&#039;d use the CASE statement (and have for exactly this) because it would be much clearer to the next developer that comes along (which may well be me) and has to figure out what that clause within the query is doing...</description>
		<content:encoded><![CDATA[<p>I&#8217;d use the CASE statement (and have for exactly this) because it would be much clearer to the next developer that comes along (which may well be me) and has to figure out what that clause within the query is doing&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan G. Switzer, II</title>
		<link>http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/comment-page-1/#comment-626</link>
		<dc:creator>Dan G. Switzer, II</dc:creator>
		<pubDate>Sat, 16 Feb 2008 13:46:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/#comment-626</guid>
		<description>I would think using a CASE statement would be much more efficient.</description>
		<content:encoded><![CDATA[<p>I would think using a CASE statement would be much more efficient.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anuj Gakhar</title>
		<link>http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/comment-page-1/#comment-622</link>
		<dc:creator>Anuj Gakhar</dc:creator>
		<pubDate>Sat, 16 Feb 2008 10:24:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/#comment-622</guid>
		<description>@Fro, yes, that&#039;s another way of doing it. I didnt think that String parsing was a time consuming thing in SQL. But I am not a SQL expert, so not really my domain. 

Thanks for the note though.</description>
		<content:encoded><![CDATA[<p>@Fro, yes, that&#8217;s another way of doing it. I didnt think that String parsing was a time consuming thing in SQL. But I am not a SQL expert, so not really my domain. </p>
<p>Thanks for the note though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fro</title>
		<link>http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/comment-page-1/#comment-618</link>
		<dc:creator>Fro</dc:creator>
		<pubDate>Sat, 16 Feb 2008 06:16:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.anujgakhar.com/2008/02/15/sql-version-of-yesnoformat/#comment-618</guid>
		<description>That&#039;s an interesting approach Anuj. Personally, I would use a CASE solution.

CASE columnname WHEN 1 THEN &#039;Yes&#039; ELSE &#039;No&#039; END AS &#039;YesNo&#039;

The primary reason I prefer this over your SUBSTRING method is that SQL Server doesn&#039;t have to do any string parsing.

You probably won&#039;t notice much of a difference with basic queries, but it could add up if you&#039;re doing some heavy lifting.</description>
		<content:encoded><![CDATA[<p>That&#8217;s an interesting approach Anuj. Personally, I would use a CASE solution.</p>
<p>CASE columnname WHEN 1 THEN &#8216;Yes&#8217; ELSE &#8216;No&#8217; END AS &#8216;YesNo&#8217;</p>
<p>The primary reason I prefer this over your SUBSTRING method is that SQL Server doesn&#8217;t have to do any string parsing.</p>
<p>You probably won&#8217;t notice much of a difference with basic queries, but it could add up if you&#8217;re doing some heavy lifting.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
