Click here to Skip to main content
15,886,629 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Respected sir/s,

In my windows application using vb.net,
i have total 4 tables having same columns,
here i want to join those 4 tables together with group and sum of there values too...

Table1
ID  Name  Sale
----------------
1   ABC   10
2   XYZ   20
3   PQR   30

Table2
ID  Name  Sale
----------------
1   ABC   30
2   XYZ   40

Table3
ID  Name  Sale
----------------
1   PQR   20
2   XYZ   20

Table4
ID  Name  Sale
----------------
1   ABC   10
2   XYZ   20



Result :
ID  Name  Sale
----------------
1   ABC   50
2   XYZ   100
3.  PQR   50


Its group total..of all 4 tables...
Please help me..

Thanks
Posted
Updated 3-Dec-13 1:56am
v2
Comments
Dharmendra-18 3-Dec-13 6:54am    
you can use like this

var query=from r1 in db.tb1
from r2 in db.tb2
from r3 in db.tb3
from r4 in db.tb4
where r1.Id==r2.Id && r2.Id==r3.Id && r3.Id==r4.Id && r4.Id==r1.Id
select new { r1.col,.. , r2.col,.. , r3.col,... ,r4.col,...}

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900