日期:2014-05-20 浏览次数:20799 次
create table Privates (
pmID char(12) not null,
sUserID char(7) null,--发送用户名
rUserID char(7) null,--接受用户名
pmBody nvarchar(max) null,
sTime datetime null,--发送时间
constraint PK_PRIVATES primary key (pmID)
)
var query1 = (from x in list
select x.sUserID).Distinct();
var query2 = from x in query1
let y = (from z in list
where z.sUserID == x
orderby z.sTime
select z).Last()
select y;