如何将其转换为 LinQ?
SELECT *
FROM YourTable
WHERE id IN (
SELECT MAX(id) FROM YourTable GROUP BY alarmId, alarmUnit
)
到目前为止尝试过但不起作用
var a= from x in YourTable .ToList()
group x by new { x.alarmId, x.alarmUnit} into g
from x1 in YourTable
where x1.ID == (from x2 in g select x2.ID).Max()
select x1;
谢谢,