let where = String.concat " and " where in
let query =
match rating with
- | None -> sprintf "select table0.source from %s where %s" from where
+ | None -> sprintf "select distinct table0.source from %s where %s" from where
| Some `Hits ->
sprintf
- ("select table0.source from %s, hits where %s
+ ("select distinct table0.source from %s, hits where %s
and table0.source = hits.source order by hits.no desc")
from where
in