 
 (defn- fieldo [{:keys [query-fields], :as query} field]
   (all (conde
-        ((aggregate-fieldo query field))
-        ((membero field query-fields)))
+        ((membero field query-fields))
+        ((aggregate-fieldo query field)))
        (valid-nameo query field)))
 
 

(defn post-annotate [qp]
  (fn [query]
    (let [results (qp query)
          cols    (time (->> (query-add-info (:query query) results)
                             resolve+order-cols
                             (map format-col)
                             add-fields-extra-info))
          columns (map :name cols)]
      {:cols    (vec (for [col cols]
                       (update col :name name)))

          (every? map? %)]}
  (let [num-cols (count (:result-keys query))
        cols     (vec (lvars num-cols))]
    (time (first (run 1 [q]
                   (== q cols)
                   (distincto q)
                   (everyg (partial fieldo query) q)
                   (everyg (fn [i]
                             (fields< query (cols i) (cols (inc i))))
                           (range 0 (dec num-cols))))))))


;;; # ---------------------------------------- COLUMN DETAILS  ----------------------------------------
