Skip to content Skip to sidebar Skip to footer

Sql Server 2008 Joining

I have some tables in my database & I want to combine them by using join but I have got a problem. Let me make it clear. I have assigned Id_num (column name) as primary key in

Solution 1:

You should consider to work with UNION rather then a JOIN.

Simplifying your query the union might look like this

SELECT           dbo.Stu_info.Id_num, dbo.Development_fee.Dvf
FROM             dbo.Stu_info 
LEFTOUTERJOIN  dbo.Tuition_fee ON dbo.Stu_info.Id_num = dbo.Tuition_fee.Id_num 
UNIONSELECT           dbo.Stu_info.Id_num, dbo.Registration_fee.Reg_fee
FROM             dbo.Stu_info 
LEFTOUTERJOIN  dbo.Registration_fee ON dbo.Stu_info.Id_num = dbo.Registration_fee.Id_num 

Post a Comment for "Sql Server 2008 Joining"