日期:2014-05-18 浏览次数:20453 次
create table tb(n int) insert tb select 1000 union select 800 union all select 1400 go select (case when n>999 then reverse(stuff(reverse(convert(varchar,n)),4,0,',')) else convert(varchar,n) end)n from tb go drop table tb /* n ------------------------------- 800 1,000 1,400 (3 行受影响) */