Hele将MSSQL查询转换为Korma实体

时间:2017-02-20 12:13:54

标签: clojure korma

我有以下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;

由于

1 个答案:

答案 0 :(得分:0)

SQL Korma文档网站包含 subselect sample

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