删除表中多余的重复记录(多个字段),只留有rowid最小的记录
delete from vitae a where (a.peopleId,a.seq) in (select peopleId,seq from vitae group by peopleId,seq having count(*) > 1) and rowid not in (select min(rowid) from vitae group by peopleId,seq having count(*)>1)
思路是对的 不过mysql中没有rowid这一说 oracle中存在 rowid这种伪列
ListVirtualNet = ListVirtualNet.GroupBy(p => new { p.IP, p.Port }).Select(g => g.First()).ToList();
正好我昨天也查了这个问题