【问题标题】:having count linq in VB在VB中有count linq
【发布时间】:2012-09-11 23:44:10
【问题描述】:

我有一个 SQL 查询,它返回重复字段以跟踪操作。

SELECT contratosfianzas.adquisicion_contrato, count(*) as no_ope 
From contratosfianzas 
GROUP BY contratosfianzas.adquisicion_contrato 
HAVING count(*) > 1

我尝试了此处显示的示例,但我总是返回 1。

你能帮帮我吗?

提前非常感谢您

【问题讨论】:

  • 您需要在Group 之后添加Where
  • 但是在 linq for VB 中我如何“翻译”

标签: sql vb.net linq


【解决方案1】:
from b in db.contratosfianzas
group b by b.adquisicion_contrato into grup
where grup.Count() > 1
select grup.Key, grup.Count()

【讨论】:

    猜你喜欢
    • 2022-08-18
    • 2011-12-10
    • 2012-06-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多