Ok, thanks all for your answers, I guest I will have to normalize the database and explore the foreign key feature.
One more thing: I have the tables "movies" and "people" Those two tables are related by tables "directors", "writers", etc... movies: id, title people: id, name directors: movieId, peopleId writers: movieId, peopleId etc... How can I normalize that so I can count directors and writers using count(*)? Should I create another table for "directors" and another for "writers", etc... with only the ids? I will end up having: movies > movies_directors < (directors people) Thanks again! -- View this message in context: http://old.nabble.com/Speed-up-count%28distinct-col%29-tp30864622p30868907.html Sent from the SQLite mailing list archive at Nabble.com. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users