Re: Help with sqlite?



"Todd Slater" <dontodd gmail com> writes:

> Thanks, since I wrote I found the id of the tag I'm interested in, and
> found I could find the photo id's of the photos with that tag in the
> photo_tags table, and then find the location in the photos table, but
> I couldn't figure out how to do it with one select statement.
>
> You're right, though, I didn't realize a "copy photo location" would
> work for multiple selections. That is easier, but it would still be
> cool to automate it. Thanks for the idea!

Following query did it for me:

SELECT photos.directory_path, photos.name
FROM photos 
INNER JOIN photo_tags 
  ON photos.id = photo_tags.photo_id 
INNER JOIN tags 
  ON tags.id = photo_tags.tag_id 
WHERE tags.name = 'screensaver';

-- 
   Psi -- <http://www.iki.fi/pasi.savolainen>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]