delete from detail where autoid not in (select min(autoid) from detail
where CATEGORY<>'Accepted'
group by ATM_Id, Date, Card ,Transit ,Ck)
and CATEGORY<>'Accepted'
我尝试了什么
var Query2 = from line in
(from line in source let fields = line.Split(',')
select new { autoid = fields[0],
ATMID = fields[4],
DATE = fields[2],
CARDNo = fields[5],
TRANSIT = fields[8],
CheckNo = fields[9],
CATEGORY = fields[10],
})
orderby line.ATMID,
line.DATE,
line.CARDNo,
line.TRANSIT,
line.CheckNo ascending
where line.CATEGORY != "Accepted"
group line by new { line.ATMID,
line.DATE,
line.CARDNo,
line.TRANSIT,
line.CheckNo }
into gruoped
where gruoped.Count() > 1
//select autoid = gruoped.Key;
select new
{
//ATMID = gruoped.Key,
//DATE = gruoped.Key,
//CARDNo = gruoped.Key,
//TRANSIT = gruoped.Key,
//CheckNo = gruoped.Key,
autoid = gruoped.Key,
//CATEGORY = gruoped.Key
};