   (subselect field (fields :id) (where {:dataset_id exp})))
 
 (defn- scores-with-fields [fs]
-  (subselect field_score (fields :score_id) (where {:field_id [in fs]})))
+  (subselect field_score (fields :scores_id) (where {:field_id [in fs]})))
 
 (defn- clear-by-exp [exp]
   (let [f (fields-in-exp exp)]

                     :join  [{:table  [[[:name2 :varchar fields]] :T]}  [:= :name2 :field.name]]
                     :where [:= :dataset_id dataset-id]} :P]]
            :left-join [:field_score [:= :P.id :field_score.field_id]]}]
    :left-join [:scores [:= :score_id :scores.id]]})

; {"foxm1" [{:NAME "foxm1" :SCORES <bytes>} ... ]
(let [concat-field-bins

  ["CREATE TABLE IF NOT EXISTS `field_score` (
   `field_id` INT,
   `i` INT,
   `scores_id` INT,
   UNIQUE (`field_id`, `i`))"])

(def cohorts-table
  ["CREATE TABLE IF NOT EXISTS `cohorts` (
