select id,OrderID,Mobile,Name from (select id,OrderID,Mobile,Name from V_Order where len(isnull(Mobile,''))>0 and State=0) Customer where id in (select min(id) from (select id,OrderID,Mobile,Name from V_Order where len(isnull(Mobile,''))>0 and State=0) Customer group by Mobile ) order by Name desc
select id,orderId,Mobile,Name from ( select row_number() over(order by id) rowId,id,orderId,Mobile,Name from v_order where len(isnull(Mobile,''))>0 ) as tt where rowId in ( select min(rowId) from (select row_number() over(order by id) rowId,id,orderId,Mobile,Name from v_order where len(isnull(Mobile,''))>0 ) bb group by Mobile having count(id)>=1 )