gpt4 book ai didi

c# - 如何使用 NH 生成 "select count(*)as y from (select distinct x, y from tableName) as t"?

转载 作者:行者123 更新时间:2023-11-30 16:32:20 26 4
gpt4 key购买 nike

关于如何使用 Criteria API 使用 Nhibernate 生成后续查询有什么想法吗?

select count(*)as z from (select distinct x, y from tableName) as t

select count(distinct (x , y)) as z FROM tableName

返回相同结果的一些其他查询。

最佳答案

您可以尝试在 ICriteria API 和投影的帮助下生成这样的查询。您需要的是 Projections.RowCount()Projections.Distinct()Projections.Property()

关于c# - 如何使用 NH 生成 "select count(*)as y from (select distinct x, y from tableName) as t"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4129047/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com