SELECT CASE field0010 WHEN '计划' THEN 1 ELSE 2 END AS s FROM formmain_5991
SELECT CASE WHEN (IFNULL(o.ENDTIME,99))=99 THEN (CASE WHEN (CURDATE()-pc.FORECASTTIME)>0 THEN (CASE WHEN (CURDATE()-pc.FORECASTTIME)>7 THEN 2 ELSE 1 END) ELSE 0 END) ELSE 0 END AS overtime FROM tb_a
select case when 项目名称 IS NULL then '空值' when 项目名称 ='北二环' then 'A' when 项目名称 ='北三环' then 'B' else 'C' END 项目名称 from 物件设计数量统计表
SELECT field0001 AS 项目名称, field0002 AS 项目编号, field0003 AS 计划开始, field0004 AS 计划结束, field0005 AS 节点名称, CASE field0010 WHEN '计划' THEN field0012 ELSE CASE isnull(field0012, 0) WHEN 0 THEN field0003 WHEN 1 THEN field0012 END END AS 节点开始时间, CASE field0010 WHEN '计划' THEN field0013 ELSE CASE isnull(field0013, 0) WHEN 0 THEN getdate() WHEN 1 THEN field0013 END END AS 节点结束时间, CASE field0010 WHEN '计划' THEN field0013 ELSE field0013 END AS 节点里程碑时间, field0006 AS 节点编号, field0010 AS 节点类型 FROM formmain_5991