【问题标题】:Hele converting MSSQL query to Korma entitiesHele 将 SQL 查询转换为 Korma 实体
【发布时间】:2017-02-20 12:13:54
【问题描述】:

我有以下 MSSQL 查询,我无法找出 Korma 实体。请帮忙

select t.d as did from (
            select  dataid as d , count(dataid) as 
            cd  from <table_name> 
            WHERE prid = <pid>  group by dataid
        ) as t  WHERE t.cd >1;

谢谢

【问题讨论】:

    标签: clojure korma


    【解决方案1】:

    SQL Korma 文档站点包含 subselect sample:

    ;; Subselects can be used as entities too!
    (defentity subselect-example
      (table (subselect users
                (where {:active true}))
             :activeUsers))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-11
      相关资源
      最近更新 更多