日期:2014-05-18 浏览次数:20800 次
-- 测试数据:#
if object_id('tempdb.dbo.#') is not null drop table #
create table #(f1 float)
insert into #
select 1.2345 union all
select 0.0852585 union all
select 0 union all
select 234.155544
select *, case f1 when 0 then '' else convert(varchar,f1,128) end s1 from #
/*
f1 s1
---------------------- ------------------------------
1.2345 1.2345
0.0852585 0.0852585
0
234.155544 234.155544
*/