I have a table CREATE TABLE [Tiles] ( TileID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, PatternID INTEGER NOT NULL REFERENCES [Patterns] DEFERRABLE INITIALLY DEFERRED, Offset_X REAL NOT NULL DEFAULT 0.0, Offset_Y REAL NOT NULL DEFAULT 0.0 );
And I can get the number of unique Y offsets in a pattern like so: SELECT COUNT(Offset_Y) FROM (SELECT DISTINCT Offset_Y FROM Tiles WHERE PatternID = 1); Is it possible to have a single query that will generate a row for each PattenID, COUNT(Offset_Y) combination? i.e. 1 | 29 2 | 37 3 | 45 Thanks, Jeff Archer Nanotronics Imaging jsarc...@nanotronicsimaging.com <330>819.4615 _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users