Click here to Skip to main content
15,908,112 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
my table is like below

C#
1   Nikhil   T
2   Amit     F


i want output like

C#
1   Nikhil   True
2   Amit     False


i need something like
C#
isnull(colname,"0")


or like below

C#
select isequal(colname,'T','True'),isequal(colname,'F','False')
Posted
Updated 12-Jun-14 2:16am
v3

try this.. :)

SQL
select id,name,case ColumnName when 'T' then 'True' when 'F' then 'False' end as [Status] from ##temp1
 
Share this answer
 
v3
SQL
select id,name,case when status='T' then 'True' when status='F' then 'False' end from ##temp1
 
Share this answer
 
Thw following code will work in sql2012

SQL
SELECT *,
       Iif(btype = 't', 'True', 'False') AS res
FROM   test;


This one will work for lesser than that
SQL
SELECT *,
       CASE btype
         WHEN 't' THEN 'True'
         ELSE 'False'
       END AS res
FROM   test;


just try this Example [^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900