Created
September 23, 2013 11:56
-
-
Save phil/6669508 to your computer and use it in GitHub Desktop.
App Aperture SQL: Count Photos by make, model, lens
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select count(results.versionid) as c, results.* from | |
| (select t.versionid, max(t_make.stringproperty) as make_string, max(t_model.stringproperty) as model_string, max(t_lens.stringproperty) as lens_string from rkexifstringproperty t | |
| left outer join (select stringProperty, modelid from rkuniquestring) t_model on (t_model.modelid = t.stringid and t.propertykey = 'Model') | |
| left outer join (select stringProperty, modelid from rkuniquestring) t_make on t_make.modelid = t.stringid and t.propertykey = 'Make' | |
| left outer join (select stringProperty, modelid from rkuniquestring) t_lens on t_lens.modelid = t.stringid and t.propertykey = 'LensModel' | |
| /*where propertykey = 'Model' /* use any of 'LensModel', 'Model' */ | |
| group by t.versionid) results | |
| group by results.lens_string, results.model_string | |
| order by results.model_string, results.lens_string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment