I have the following SQL query:
SELECT games.id, games.GameTitle FROM games
WHERE EXISTS (
SELECT filename FROM banners
WHERE banners.keyvalue = games.id
AND banners.filename LIKE '%front%'
)
which is not quite correct for my use
what I'd like is something like:
SELECT games.id, games.GameTitle
FROM games WHERE EXISTS (
COUNT(SELECT filename FROM banners
WHERE banners.keyvalue = games.id AND banners.filename LIKE '%front%') > 1
)
i.e. only select when the subquery retrieves more than 1 row.