当某一列值不空时,显示"cc",哪位知道,请指教指教,谢谢!
当某一列值不空时,显示 "cc ",哪位知道,请指教指教,谢谢!语句如下,不能正确执行
SELECT A.ProjectInputType,A.RelationProject, A.relationItemsList,
(CASE C.ItemName WHEN null THEN 'cc ' ELSE C.ItemName END) ,
C.RecordID as RelationedItemID
FROM RFMItems A,RFMItems C
WHERE A.RecordID=174
------解决方案--------------------SELECT A.ProjectInputType,A.RelationProject, A.relationItemsList,
isnull(C.ItemName, 'cc '),
C.RecordID as RelationedItemID
FROM RFMItems A,RFMItems C
WHERE A.RecordID=174
------解决方案--------------------不空时是什么意思啊?是不为空还是为空啊?
不为空时显示 "CC "
SELECT A.ProjectInputType,A.RelationProject, A.relationItemsList,
(CASE WHEN C.ItemName is not null THEN 'cc ' ELSE C.ItemName END) ,
C.RecordID as RelationedItemID
FROM RFMItems A,RFMItems C
WHERE A.RecordID=174
------解决方案--------------------(CASE WHEN C.ItemName is null THEN 'cc ' ELSE C.ItemName END)
------解决方案-------------------- SELECT A.ProjectInputType,A.RelationProject, A.relationItemsList,
(CASE When C.ItemName Is null Or C.ItemName = ' ' THEN 'cc ' ELSE C.ItemName END) ,
C.RecordID as RelationedItemID
FROM RFMItems A,RFMItems C
WHERE A.RecordID=174