join :select distinct name,id,tdate from table1 inner join table2 on table1.id=table2.id order by tdate