select * from hotel_HotelLinkRelation
where id in
(SELECT min(id) FROM hotel_HotelLinkRelation hhlr
GROUP BY ExHotelCode,hhlr.GDSCode)
整了好几个小时了,实在是没有办法了,大家帮个忙。。。。。。。。。。。。。。。
------解决方案-------------------- var www =(from b in hotelData.hotel_HotelLinkRelation group b by new { b.ExHotelCode, b.GDSCode } into g select new { minId=g.Min(p=>p.id) }).First().id;
var result = from a in hotelData.hotel_HotelLinkRelation where a.id ==www select a;