create table #
(
    T varchar(10)
)insert into #
select 'A'
union
select 'B'
union
select 'C'
union
select 'D'
union
select 'E'select * from 
(select T1.T as T1,T2.T as T2 from 
(select * from #) T1,(select * from #) T2) T
where T.T1<>T.T2 and T.T1<T.T2
order by T1