>create TABLE #x1 ( firstname cHAR(10) ) >insert into #x1 values ( 'Dave' ) >insert into #x1 values ( 'Abe' ) >insert into #x1 values ( 'Albert' ) >select distinct substrING( firstname, 2, 5 ) as firstname > from #x1 > order by firstname -- this is the output column Name > >DROP TABLE #X1 >It is the group by that doesn't use output column names not the order by.