Posts Tagged ‘Linq’

Distinct in Linq to SQL

Wednesday, March 12th, 2008

I was trying to get Linq to SQL to do a Distinct query today, and found that it wasn’t quite so obvious how to do it.

This works: -

From item in table Select field Distinct

This doesn’t: -

From item in table Distinct Select field

Neither does this: -

From item in table Select field.Distinct

Note that all 3 of these appear fine with Intellisense