LLBLGen 中的嵌套选择
因此,我有以下表格:
使用 LLBLGen 2.6(适配器版本 - 无 Linq),SQL Server和.NET 3.5,我将如何编写以下查询?
SELECT o.ObjectID
FROM Object o
INNER JOIN ObjectDetail d ON i.ObjectID = d.ObjectID
WHERE d.CreatedDate = ( SELECT MAX(CreatedDate)
FROM ObjectDetail
WHERE ObjectID = o.ObjectID
)
将会有更多的过滤,但是与此无关,就像我有一个 ObjectDetailType 并且我想要某种类型的最大 ObjectDetail 行。
另外,它不必选择o.ObjectID,任何/所有列都可以。
So, I have the following tables:
Using LLBLGen 2.6 (Adapter Version - No Linq), SQL Server, and .NET 3.5, how would I write the following query?
SELECT o.ObjectID
FROM Object o
INNER JOIN ObjectDetail d ON i.ObjectID = d.ObjectID
WHERE d.CreatedDate = ( SELECT MAX(CreatedDate)
FROM ObjectDetail
WHERE ObjectID = o.ObjectID
)
There will be more filtering, however it's not relevant to this, like if I had an ObjectDetailType and I wanted the max ObjectDetail row for a certain type.
Also, it doesn't have to select o.ObjectID, any / all columns will be fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决了
Solved it