Aangezien uw subquery meerdere waarden kan retourneren, IN
zou in de youy where-clausule moeten passen.
SELECT pictures_archive_filename
FROM pictures_archive
WHERE pictures_archive_id IN
(
SELECT pictures_archive_id
FROM pictures_archive_category
WHERE pictures_category_id = 9
)
een alternatief hiervoor is om join
beide tabellen wat efficiënter is.
SELECT pictures_archive_filename
FROM pictures_archive a
INNER JOIN pictures_archive_category b
ON a.pictures_archive_id = b.pictures_archive_id
WHERE b.pictures_category_id = 9