如图,我想用linq实现根据guid中的值来分组,每组取一行数据
图中我想要的结果为
1 aaa 123
2 bbb 654
3 CCC 780用linq该如何写呢?linq

解决方案 »

  1.   

    select Guid,Name,Tel
    from 
    (
    select *,rn=ROW_NUMBER() OVER(partition by Guid ORDER BY getdate()) from tb
    )t
    where rn=1
      

  2.   

    弱弱的问一句,什么是LinQ语句?
      

  3.   

    或者帮我把这句改成linq把,我实在是改不出来,怎么都不对,拜托了,大侠!!!
    select * from T_BaseBookInfo where GUID in (select bookguid from T_BookStorage)
      

  4.   

    select [Guid],Name,Tel
    from 
    (
    select *,ROW_NUMBER() OVER(partition by Guid ORDER BY getdate()) num from tb
    )A
    where num=1