SQL: show description in text instead of bit value

前端 未结 1 558
予麋鹿
予麋鹿 2021-01-14 03:12

I have an attribute declared as bit: (true or false).

For example:

SELECT myBit FROM [table] 

=> it will show: 1 or 0

I wou

相关标签:
1条回答
  • 2021-01-14 03:54

    For SQL Server, you can use a CASE statement:

    SELECT CASE myBit WHEN 1 THEN 'Valid' WHEN 0 THEN 'Invalid' END As MyColumn
    FROM [table] 
    
    0 讨论(0)
提交回复
热议问题