我用LINQ概念写subQuery. [英] I to write subQuery in LINQ concepts..?

查看:57
本文介绍了我用LINQ概念写subQuery.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查询1:

customerReviews
中选择前2个* 查询2:

customerReviews 中选择前10个*,而不是rev​​iewid(从customerReviews中选择前2个reviewid)




我要在Linq Concepts中查询这2个查询.

我从单个表中编写了一个查询.

请寄给我....

Query 1 :

select top 2 * from customerReviews
Query 2 :

select top 10 * from customerReviews where reviewid not in (select top 2 reviewid from customerReviews)




This 2 Queries i want in Linq Concepts.

i write a query from single table.

please sent me....

推荐答案



我有一些代码可以满足您的要求,只需检查一下即可

Hi,

I''ve some code for your requirement just check this once

 IQueryable<customerreviews> f = ((from g in db.customerReviews
                         select g).Skip (2)).Take(10);
</customerreviews>



希望对您有帮助

最好的



I hope this helps you

All the Best


这篇关于我用LINQ概念写subQuery.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆