Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Outer Join Several Tables

Author  Topic 

sg2255551
Constraint Violating Yak Guru

274 Posts

Posted - 2010-04-22 : 22:15:00
hi

I have a few PK tables which are P,PT,S that join to a single table TS which is the FK table.

I am not able to show all record from SType, SHour,PT_PTitle except for P_Name.

How should i go about it? Thanks

SELECT P.P_Name, S.SType, S.SHour, PT.PT_Title,TS.Mark
FROM TS RIGHT OUTER JOIN
PT ON TS.PT_ID = PT.PT_ID RIGHT OUTER JOIN
S ON TS.SID = S.SID RIGHT OUTER JOIN
P ON TS.P_ID = P.P_ID

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-23 : 02:28:19
sorry i'm not clear. can you show some data from table and them explain what you want?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -