> Message: 10 > Date: Wed, 19 Feb 2014 09:11:27 -0500 > From: Igor Tandetnik > > select strftime(...) as year, sum(ISO=100) > FROM exifdata GROUP BY year ORDER BY year; > > ------------------------------ > > Message: 11 > Date: Wed, 19 Feb 2014 09:16:56 -0500 > From: Richard Hipp
> Maybe this: > > SELECT strftime('%Y', CreateDate, 'unixepoch') AS year, > sum(iso==100) > FROM exifdata WHERE year NOT NULL > GROUP BY year > ORDER BY year; > > The main trick is to use "sum(iso==100)" instead of "count(iso)". Note > also that SQL strings use a single quote, not a double-quote. And the > datetime() function call is redundant as strftime can do the unixepoch > conversion for you. And you don't need to GROUP BY iso, since you are only > interested in a single iso value. Thank you Igor and Richard for your fast replies. It solved my problem. I thought about using sum() or total() but the ISO==100 part is something I would never have thought about. thanks again, Patrick _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users