Mysql Obtain attributes of one kind

Asked 2 years ago, Updated 2 years ago, 35 views

When schema is defined in mysql as follows

How can I get the name of a trainer who has one type of Pokemon?

mysql

2022-09-22 20:42

1 Answers

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';


2022-09-22 20:42

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.