LINQ Gymnastics: Creating A Predictive Query With LINQ(blog.wekeroad.com)

submitted by adminjewadminjew(1490) 4 years, 2 months ago

The Code I wrote about this before, but the best way to approach a difficult query is to cut it up into pieces. It really helps in this case, since what we’re doing is statistical and therefore may seem simple, but isn’t really. So let’s break it out: * We need to know all the Orders that our Product was part of * We need all of the Products that were part of those Orders, omitting the one we just bought * We need to roll these up by the SUM of the quantity of the products bought, and order them in descending order * We need to take the top 5 of this SUM, and query the Products table for the related Products

add a comment |category: |Views: 5

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story