tsql replace value on select

Posted by Zelter Ady on Stack Overflow See other posts from Stack Overflow or by Zelter Ady
Published on 2012-11-04T12:53:38Z Indexed on 2012/11/04 17:01 UTC
Read the original article Hit count: 380

Filed under:
|
|

I have a column (SERVICE_ID) in my table where I can have only 3 values: 0, 1 and 2. I'd like on select, on displayed result table, to change those value with some english words.

select client, SERVICE_ID
from customers

displays now:

--------------------------
| John     | 1
| Mike     | 0
| Jordan   | 1
| Oren     | 2
--------------------------

I'd like to change the query to get:

--------------------------
| John     | QA
| Mike     | development
| Jordan   | QA
| Oren     | management
--------------------------

There is any way to do this using only the select?

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about tsql