Using If else in SQL Select statement

后端 未结 11 1615
感情败类
感情败类 2020-12-24 05:35

I have a select statement which will return 2 columns.

ID | IDParent

Then in my program I have to test if IDParent is < 1 then use

11条回答
  •  一生所求
    2020-12-24 05:53

    The query will be like follows

    SELECT (CASE WHEN tuLieuSo is null or tuLieuSo=''
                THEN 'Chưa có đĩa' 
                ELSE 'Có đĩa' End) AS tuLieuSo,moTa
    FROM [gPlan_datav3_SQHKTHN].[dbo].[gPlan_HoSo]
    

提交回复
热议问题