摘要:
第一种:CREATE TABLE #T1(C1 VARCHAR(10),C2 VARCHAR(20),C3 VARCHAR(10))INSERT INTO #T1(C1,C2,C3) VALUES('1','DCP','5')INSERT INTO #T1(C1,C2,C3) VALUES('2','PCB','8')INSERT INTO #T1(C1,C2,C3) VALUES('6','ECD','9')INSERT INTO #T1(C1,C2 阅读全文
摘要:
select 5000/10000.0 --想变成0.5select 5500/10000.0 --想变成0.55select 5550/10000.0 --想变成0.555select 5555/10000.0 --想变成0.5555其结果分别为:0.5000000 0.5500000 0.5550000 0.5555000一、如果想去掉数字5后面多余的0 ,需要转化一下:select CONVERT(FLOAT,5000/10000.0) --想变成0.5select CONVERT(FLOAT,5500/10000.0) --想变成0.55select CONVERT(FLOAT,555 阅读全文