0

I am writing a query to a entity object, is it possible to use distinct on a column ? below is my query

  query = From r In objEntity.W_PDD
           Join p In objEntity.W_PER
           On r.PER_NO Equals p.PER_NO
            Where p.RECEIVED_DATE = DateTime.Today
            Order By r.PER_NO Select r
RookieRoll
  • 175
  • 1
  • 1
  • 16
  • Nope I have tried it that did not work and I also tried using the Distinct inside the query that too did not work. query = (From r in ......... Distinct Select r) – RookieRoll Dec 14 '15 at 17:22
  • What exactly do you want to be distinct? Is there a one to many relationship to W_PER? You probably will be fine with a group by, but hard to say without details of your data model. – Hogan Dec 14 '15 at 17:25
  • 1
    please give example of current output and desired output. – Hogan Dec 14 '15 at 17:27
  • If you want Distinct on certain column, best thing you can do is GroupBy that column, followed by `Select(r => r.FirstOrDefault()` – Alexander Derck Dec 14 '15 at 18:20

0 Answers0