Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Linq with multiple joins and group by


Linq with multiple joins and group by

Author
Message
sachinbb
sachinbb
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 113
Have any of you worked on converting a SQL query with multiple joins and group by multiple columns

I am trying to convert the following into VB.NET LINQ to dataset

 select a.a1, Sum(b.b1 * c.Q) [V_QTY], c.c1, a.a2 , b.b2,d.d1, d.d3, e.e1, c.c2, c.c3
from a
join (select id, a as c1,b as c2, count(num) Q, c as c3, d as c4
from abc
where a=1 and id=3723
group by a, b, c, d) c on a.id= h.id
left join b on b.id = c.id
left join d on d.id= d.id
where c.a= 1
group by select a.a1, c.c1, a.a2 , b.b2,d.d1, d.d3 , c.c2, c.c3
order by c.c1, c.c2, b.b2



Since i have a nested join and i am grouping at both levels it is proving to be a bit awkward. I am also getting familiar with LINQ to dataset. Any help would be appreciated.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search