在sql server中转换

时间:2014-02-27 11:11:22

标签: sql sql-server sql-server-2005

如何在SQL Server中将123456.78转换为123,456.78

我从123456.78这样的表中获取数据,我必须将其显示为123,456.78

3 个答案:

答案 0 :(得分:2)

试试这个,

SELECT CAST(CONVERT(varchar, CAST(123456 AS money), 1) AS varchar)

用您的号码替换123456

答案 1 :(得分:1)

SELECT CONVERT(varchar, CAST(123456 AS money), 1) 

答案 2 :(得分:0)

试试这个

SELECT CONVERT(varchar, CAST(123456.78 AS money), 1) as Value