Replace number with word using CASE statement in SQL Server

Last Reply 2 months ago By pandeyism

Posted 2 months ago

i have a query:

 

select emp.name,emp.address,emp1.app_status from Table inner join table1

I am exporting it into excel file. In the database app_status is in the form of 0 and 1.

1 means application received. 0 means application not received.

i am getting the app_status column as in the form of 0 and 1.(while exporting to excel file)

How to make it in words in sql query.

Posted 2 months ago

Use case statement.

SELECT emp.name,emp.address,
case when emp1.app_status = 1 then 'application received'  
     when emp1.app_status = 0 then 'not received' end as appstatus 
FROM table emp
inner join table1 emp1 on emp.id = emp1.id