select DISTINCT a.teach_id , a.name FROM a INNER JOIN b ON a.teach_id = b.tid WHERE a.teach_condition ='1' ORDER BY name