qq_25343655
代码是我快乐
采纳率100%
2016-05-15 14:22

关于SQL语句转换成linq语句

已采纳

SELECT * FROM dbo.[USER] u,
(SELECT ua.User_Attention_Object_Id FROM dbo.User_Attention ua,dbo.[USER] u
WHERE u.User_Id=ua.User_Attention_User_Id AND ua.User_Attention_User_Id=3) uaid
WHERE u.User_Id=uaid.User_Attention_Object_Id

还望好心人帮我一下,感激不尽!!

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

2条回答

  • caozhy 回答这么多问题就耍赖把我的积分一笔勾销了 5年前

    var uaid = from us in User_Attention
    select ua.User_Attention_Object_Id
    where u.User_Id==ua.User_Attention_User_Id && ua.User_Attention_User_Id==3;
    var query = from u in User
    WHERE u.User_Id==uaid.User_Attention_Object_Id
    select u;

    点赞 评论 复制链接分享
  • caozhy 回答这么多问题就耍赖把我的积分一笔勾销了 5年前

    也可以写在一起
    var query = from u in User
    let uaid = (from ua in User_Attention
    select ua.User_Attention_Object_Id
    where u.User_Id==ua.User_Attention_User_Id && ua.User_Attention_User_Id==3)
    WHERE u.User_Id==uaid.User_Attention_Object_Id
    select u;

    点赞 评论 复制链接分享

为你推荐