学习,生活
前两天选择一个FLOAT型的字段,要转换为VARCHAR,可是小数点后面的都自动被删去了。。。后查得可以通过如下转换获得:
SELECT CAST(CAST(字段 AS DECIMAL(20,7)) AS VARCHAR(20)) FROM 要查的表或者
SELECT CONVERT(VARCHAR(20),CONVERT(DECIMAL(20,7),字段)) FROM 要查的表
Copyright @ 2024 将飞 Powered by .NET 9.0 on Kubernetes Powered by: .Text and ASP.NET Theme by: .NET Monster