This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I wrote a simple LINQ query to group by customer and count the number of results, returning the result to a new type containing the Customer and their count. (See below)
The resulting SQL query gets the entire table.
Is there a way to write the query so it doesn't download the entire table and runs the count in SQL similar to below?
|
|
|
You can do this as a single statement using the native querying API but not through LINQ. Because LINQ has the potential for subsequent client side projections we execute one query to retrieve the grouping sets and then one query per set to retrieve the members as required. With the underlying querying API you can specify this as:
|
|