主题:[讨论]难解的SQL语句,请大家帮忙小菜菜
是这样的,我刚学 SQL2005,下面写了语句, 其中我想把值是1和0 的转化成true 或false,但是运行后竟然出现很奇怪的现象:DetailSign的是依旧是0或1,而CreateTime却成了true /false,实在不知道是哪错了!希望大侠指点,先谢谢大家~~
select ProductID,
ProductNumber,
ProductName,
ProductSpecification,
Unit,
Remarks,
DetailSign,case DetailSign when 1 then 'true' when 0 then 'false' end
InUse,case InUse when 1 then 'true' when 0 then 'false' end
CreateTime,
ChangeTime,
Creater,
Changer
from BasicData_Product
order by ProductNumber
select ProductID,
ProductNumber,
ProductName,
ProductSpecification,
Unit,
Remarks,
DetailSign,case DetailSign when 1 then 'true' when 0 then 'false' end
InUse,case InUse when 1 then 'true' when 0 then 'false' end
CreateTime,
ChangeTime,
Creater,
Changer
from BasicData_Product
order by ProductNumber