:distinct-on helper fn; fixes #1

This commit is contained in:
Justin Kramer 2013-08-06 16:29:09 -04:00
parent 23659e94bc
commit 7d4cc64ecb

View file

@ -76,6 +76,9 @@
(defmethod fn-handler "count-distinct" [_ & args]
(str "COUNT(DISTINCT " (comma-join (map to-sql args)) ")"))
(defmethod fn-handler "distinct-on" [_ & args]
(str "DISTINCT ON (" (comma-join (map to-sql args)) ")"))
(defmethod fn-handler "=" [_ a b & more]
(if (seq more)
(apply expand-binary-ops "=" a b more)