I have a table like this (Table name: Posts):
+----+--------------------------+-------+------------+
| id | content | type | date |
+----+--------------------------+-------+------------+
| 0 | Some text | TypeA | 2013-04-01 |
| 1 | Some older text | TypeA | 2012-03-01 |
| 2 | Some even older texttext | TypeA | 2011-01-01 |
| 3 | A dog | TypeB | 2013-04-01 |
| 4 | And older dog | TypeB | 2012-03-01 |
| 5 | An even older dog | TypeB | 2011-01-01 |
+----+--------------------------+-------+------------+
Using a LINQ expression I want to find the newest content of each type, so the result should be
Some text | TypeA
A dog | TypeB
I have tried a few things but no point in pointing out non-working expressions.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…