Convert bit type to Yes or No by query Sql Server 2005

后端 未结 5 922
一整个雨季
一整个雨季 2021-01-07 17:48

I Want convert bit type to Yes or No

For Example:

SELECT FirstName, LastName, IsMale from members
         


        
5条回答
  •  鱼传尺愫
    2021-01-07 17:54

    You can do this using a searched case expression:

    SELECT
        FirstName,
        LastName,
        CASE WHEN IsMale = 1 THEN 'Yes' ELSE 'No' END AS IsMale
    FROM
        Members
    

提交回复
热议问题