Hi,
Your query does not give any ideas about what fields refer to what tables but this should give you some ideas:
from sh in dc.StokHareket
join s in dc.Stoklar on sh.stokIdent equals s.SthStok
join c in dc.Cariler on sh.SthDepo equals c.CarIdent
group new { sh,s,c } by new { c.CariKod, s.stokKod } into grp
where grp.Max(c=>c.CariTip) = 3
select new
{
DepoNo = grp.Key.CariKod,
grp.Max( c=>c.CariNum ),
grp.Where(g=>g.s.sthIslem == '+').Sum( s=>s.SthMiktar )
...
}
Notice that I am creating an anonymous type for grouping as described
here to get all values from different tables.
Regards,
Syed Mehroz Alam
My Blog |
My Articles