Re: Help with sqlite?



> I couldn't figure out how to do it with one select statement.

SELECT p.directory_path, p.name
FROM photos AS p
  INNER JOIN photo_tags AS pt ON pt.photo_id = p.id
  INNER JOIN tags       AS t  ON pt.tag_id   = t.id
WHERE t.id = 3;

t.id - it's id of your tag
This query is rather slow
Joins are resource hungry



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