sql server - How to get columns from table 1 to table 3 -


t_category:

catid(pk)|catname

t_log:

logid(pk)|catid(fk)

t_report:

reportid|logid(fk)

is possible catname t_category in t_report table

want output :

t_report: reportid| logid | catname

select r.*, c.catname t_report r inner join t_log l on r.logid = l.logid inner join t_category c on c.catid = l.catid  

should trick you.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -