【发布时间】:2009-08-06 21:30:26
【问题描述】:
我只处理一个数据库表/实体对象:NodePath。
给定一个特定的节点,我想根据这个查询只获取它所有节点路径的一个子集:
select
*
from
NodePath
where
NodeId = @GivenNodeId and
Id in
(
--active paths
select
a.Id
from
NodePath a join
(
select
[Path],
max(Created) as Created
from
NodePath
group by
[Path]
) b on
a.[Path] = b.[Path] and
a.Created = b.Created
)
如何在我的 VB.NET 应用程序中执行此操作?
Dim AllPaths = GivenNode.NodePaths.OrderByDescending(Function(p) p.Created)
Dim ActivePaths = ???
【问题讨论】:
标签: .net linq tsql entity-framework stored-procedures