How to do inner join with 4 tables [Resolved]

Posted by Pallubhosale under Sql Server on 1/28/2014 | Points: 10 | Views : 1408 | Status : [Member] | Replies : 2
Hi,
how to do inner join with following 4 tables according to fileno.

table 1) Traning - Fields :FILENO,TITLE,STARTDATE,ENDDATE
table 2)Real COST- Fields :FILENO,COSTELEMENT,AMOUNT,GST
table 3)REAL_SBU- Fields : FILENO,SBU,NOPPT
table 4)REAL_COURSE_FEE -Fields : FILENO,FEECODE,FEEPERPPT

Thanks

Pallavi


Responses

Posted by: kgovindarao523-21772 on: 1/28/2014 [Member] [MVP] Bronze | Points: 50

Up
0
Down

Resolved
Hi,
Try like this.

SELECT Distinct * FROM Traning t

INNER JOIN RealCOST rc ON t.FILENO=rc.FILENO
INNER JOIN REAL_SBU rs ON t.FILENO=rs.FILENO
INNER JOIN REAL_COURSE_FEE rf ON t.FILENO=rf.FILENO



Thank you,
Govind

Pallubhosale, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 1/28/2014 [Member] [MVP] Platinum | Points: 25

Up
0
Down
SELECT t.TITLE, t.STARTDATE, t.ENDDATE, rc.COSTELEMENT, rc.AMOUNT, rc.GST, rs.SBU, rs.NOPPT, rcf.FEECODE, rcf.FEEPERPPT 
FROM Traning t
JOIN [Real COST] rc ON t.FILENO = rc.FILENO
JOIN REAL_SBU rs ON t.FILENO = rs.FILENO
JOIN REAL_COURSE_FEE rcf ON t.FILENO = rcf.FILENO


Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Pallubhosale, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response