公告
财富商城
积分规则
提问
发文
2019-03-06 23:46发布
We Are One
SELECT count(*) FROM table A
let's say the result is 8689. How can I convert it to 8'689 on the SQL Server?
8689
8'689
Try This way:-
select replace(convert(varchar,convert(Money, count(*)),1),'.00','') from table_name
and be sure you really need this approach, formatting the application is the usual and best as SqlZim said.
UPDATE:-
for setting the separator on top, Try the next:-
select replace( replace(convert(varchar,convert(Money, count(*)),1),'.00',''),',','''') from table_name
最多设置5个标签!
Try This way:-
and be sure you really need this approach, formatting the application is the usual and best as SqlZim said.
UPDATE:-
for setting the separator on top, Try the next:-