Hello,
I am a LLBLGen newbie, using version 1.0.2005.1 final.
I generate code using the adapter scenario for VS.net 2005, c#, SQL server.
Converting simple sql to using entityCollections, Predicates, etc wasn't too hard. But now I have a sql select statement that is a bit overwhelming me. Writing it in SQL was OK but i dont know where to start 'translating' it...
So, if anybody can give me some hints on how to use subquerys and how to use group by, i'd be very thankful. Links to examples would be very useful!
What i'm trying to do is this:
select top 5 od1.parentcode, od1.brand, od1.category, [product].name
from orderdetail od1 left join [product] on od1.ProductCode = product.Code
where od1.category = @category and product.[sale-price] is not null and od1.parentcode <> @parentcode and od1.orderID in
(select od2.orderID from orderdetail od2 left join [order] on od2.orderID = [order].orderid where od2.parentcode = @parentcode )
group by od1.parentcode, od1.brand, od1.category, [product].name
order by count(od1.parentcode) desc
(Hope i'm posting in the right group)
Thanks,
Steve