I have a two tables,Transaction and Master. The transaction table shows a from and to activity id. The master shows the activity id and a name. The from and to id use the
select distinct a.from, f.name as FromName, a.to, t.name as ToName from Transaction a join Master F on a.from = f.id join Master T on a.to = f.id