Hi,
I've got a problem in combining expressions. On combining multiple ANDs with an OR within a SELECT WHERE clause, SQLite takes years to respond. (Database has a size of only about 1 MB). Using two SELECTs and combining them by UNION works like a charm! What could be the problem here? This statement takes about 10 seconds after result can be read: SELECT <.> FROM Scenes AS s, Movies AS m, Categories AS c WHERE m.Id = s.MovieId AND ((s.MovieId = c.MovieId AND s.SceneNo = c.SceneNo AND c.CategorieId IN (60)) OR Rating IN (2)) Working statement (immediate response): SELECT <.> FROM Scenes AS s, Movies AS m, Categories AS c WHERE m.Id = s.MovieId AND s.MovieId = c.MovieId AND s.SceneNo = c.SceneNo AND c.CategorieId IN (410) UNION SELECT <.> FROM Scenes AS s, Movies AS m WHERE m.Id = s.MovieId AND s.Rating IN(1) I am using System.Data.SQLite from http://sqlite.phxsoftware.com/ Thanks for any response! Regards, Markus _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users