SQL syntax multiple joins?

前端 未结 1 1001
傲寒
傲寒 2021-01-05 06:25

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

相关标签:
1条回答
  • 2021-01-05 06:49
    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
    
    0 讨论(0)
提交回复
热议问题