Rishin S Babu
Rishin S Babu

Reputation: 1693

Hele converting MSSQL query to Korma entities

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

Upvotes: 0

Views: 53

Answers (1)

ygun
ygun

Reputation: 95

SQL Korma documentation site contains subselect sample:

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

Upvotes: 0

Related Questions