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
Post a Comment