score:8
Accepted answer
Here's an example from MSDN of grouping in VB:
Dim query = From p In db.Products _
Group p By p.CategoryID Into g = Group _
Select CategoryID, MaxPrice = g.Max(Function(p) p.UnitPrice)
If you omit the "= Group", it will consider g as a function. Hope this helps.
score:8
Dim q = From n In table _
Group n By n.AccountId Into g _
Select g.OrderByDescending(Function(t) t.Date).First()
Source: stackoverflow.com
Related Articles
- How to select only the records with the highest date in LINQ
- LINQ VB how to select records with the max date (highest date)
- How to select a record and only it's children with the highest date in LINQ to SQL
- Select the record with highest date and INCLUDE relevant tables with it - LINQ
- Select multiple records based on list of Id's with linq
- How can I select items with Linq by Date while ignoring Time portion of a DateTime property?
- Get latest record and group with highest date - LINQ
- LINQ to select a column with max date from a group
- NHibernate - Select Random Number of Records with LINQ
- Linq query to return all records with select new statement
- Get the max date from linq with mutiple joins and with multiple select fields
- Select records with max date in datatables Uipath
- asp.net mvc select with date in Linq to entity
- Select the most recent date in a LINQ query with an inner join
- Linq Select all records newer than a specific date
- LINQ select row with the minimum date value
- LINQ Select Row with Max date per group
- Select data excluding a subset of records with LINQ with minimal overhead
- Select the first records for a property with linq
- Linq select records closest to date
- Select Distinct from list in date range with LINQ
- Select All records of a class with LINQ query
- Select all records from a db if there modified date is greater or now using linq
- How to select needed records in joining table using LINQ with tables which have many to many relationship?
- How to get group of records with latest date using Linq to Entities
- Can't Select Records from a database table with grouping using Linq
- Fetch records with highest count from each group uniquely in Linq
- LINQ filter Range Date with Select Case
- How to select only string records with contains conditions using Linq
- Linq select time with date + 1
- LINQ to Entities does not recognize the method exception
- Using LINQ expressions for custom data types
- How to serialize partial classes with WebAPI and Linq
- Get and add all properties of type Mname from a list of objects and add them dynamically too a drop down
- Using entity framework to detect changes in related table and action appropriate inserts and deletes
- LINQ Query generates unnecessarily long SQL
- Linq query to group items and query from the top item in each group
- Using expression trees to create a custom order by in linq to entities
- Group by and select in Enity Framework Core
- Linq Table select where IN IQueryable
- Building XML using Linq from a List<CustomClass>
- How to quickly match names (fname, lname) in different order with full name c#
- LINQ return expression if expression does not match
- FormViewModel in MVC for Relations
- How to get all parents with a specific child value in asp.net mvc using LINQ?
- Optimizing queries in Entity Framework Core / LINQ for group by / count()
- How to create IQueryable collections?
- XDocument reading child elements
- Convert List of Objects to Tabular Structure
- Collection list to grouped collection list using linq