hi,all....i got this error :
ORDER BY items must appear in the select list if SELECT DISTINCT is specified.
my query is :
select distinct(t1.[name]) from [test1] as t1,[test2] as t2 where t1.[name]=t2.[name] order by t2.[id] asc
when i used this query at mysql,i didnt got any error,but when i try to change to sql_server,i got error.....i want to get distinct name from table one and order by table2.id..
thanks.
ORDER BY items must appear in the select list if SELECT DISTINCT is specified.
my query is :
select distinct(t1.[name]) from [test1] as t1,[test2] as t2 where t1.[name]=t2.[name] order by t2.[id] asc
when i used this query at mysql,i didnt got any error,but when i try to change to sql_server,i got error.....i want to get distinct name from table one and order by table2.id..
thanks.
Comment