aghaux
aghaux

Reputation: 749

Linq distinct on two columns

How can i select data from DB using LINQ and distinct results by two columns?

SQL:

SELECT distinct date, SSN
FROM tablename

Upvotes: 1

Views: 1050

Answers (1)

Duane Theriot
Duane Theriot

Reputation: 2185

var query = (from t in tableName
             select new { t.date, t.SSN }).Distinct();

Upvotes: 4

Related Questions