use distinct for queries that is also supported in sqlite
test for stats app