create table t(id int identity(1,1),n ntext)
insert into t select 'a'
insert into t select 'b'
insert into t select 'a'
insert into t select 'b'
insert into t select 'c'
insert into t select 'd'
select cast(n as varchar) from t group by cast(n as varchar)
drop table t
--测试--
a
b
c
d
insert into t select 'a'
insert into t select 'b'
insert into t select 'a'
insert into t select 'b'
insert into t select 'c'
insert into t select 'd'
select cast(n as varchar) from t group by cast(n as varchar)
drop table t
--测试--
a
b
c
d
上述的方法可行.否则处理不了.
我只好自己编个程序来解决这个问题了,难道sql server里真的没这个功能?