选择 。 。存在的地方 [英] Select . . Where Exists
本文介绍了选择 。 。存在的地方的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在现有系统中,我有一个公平的常见的select / exists语句,我无法在LightSwitch中看到实现此功能的简单方法,因此任何建议都将受到赞赏。声明是:
Select Items.ID,Items.ItemName
从项目
其中已存在(选择ItemsSuppliers.SupplierItemRef从ItemsSuppliers凡Items.ID = ItemsSuppliers.ItemID)
< p style ="margin:0in; font-family:Calibri; font-size:11.0pt">
解决方案
你或许可以根据您的"Item"实体创建一个查询,并使用PreprocessQuery方法获取相关结果。
$
"购买特定产品的所有客户"示例可能会让您接近所需。
$
http://msdn.microsoft。 com / zh-CN / library / ff852040.aspx
$
我曾尝试使用此方法创建"NOT EXISTS"查询但无法完全理解LINQ语法。希望你有更好的运气!
Hi,
In an existing system I have a fairly common select/exists statement and I can't see a simple way of achieving this in LightSwitch so any suggestions would be appreciated. The statement is:
Select Items.ID, Items.ItemName
From Items
Where Exists (Select ItemsSuppliers.SupplierItemRef From ItemsSuppliers Where Items.ID =ItemsSuppliers.ItemID)
解决方案
You might be able to create a query based on your 'Item' entity and to use the PreprocessQuery method to obtain the relevant results.
The 'All Customers Who Purchased a Specific Product' example might take you close to what you need.
http://msdn.microsoft.com/en-us/library/ff852040.aspx
I once tried to create a 'NOT EXISTS' query using this method but couldn't quite get the LINQ syntax correct. Hope you have better luck!
这篇关于选择 。 。存在的地方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文