When schema is defined in mysql as follows
How can I get the name of a trainer who has one type of Pokemon?
mysql
Join each table.
SELECT a.name
FROM Trainer a, CatchedPokedmon b, Pokemon c
WHERE a.id = b.owner_id
AND b.pid = c.id
AND c.type = 'Type name';
© 2024 OneMinuteCode. All rights reserved.