Hele converting MSSQL query to Korma entities

54 Views Asked by At

I have the below MSSQL query for which I am not able to figure out the Korma entities. Please help out

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;

Thanks

1

There are 1 best solutions below

0
ygun On

SQL Korma documentation site contains subselect sample:

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