My database looks something like:
Parent:
+----+-------+
| ID | Name |
+----+-------+
| 1 | Stage |
| 2 | Prod |
+----+-------+
Children:
+-------+-------+--------+
| Name | Value | Parent |
+-------+-------+--------+
| Bob | 10 | 1 |
| Smith | 5 | 1 |
| Jack | 3 | 1 |
| Bob | 10 | 2 |
| Smith | 5 | 2 |
| Jack | 3 | 2 |
| Black | 2 | 2 |
+-------+-------+--------+
How could I query for the parent by using the different children name as part of my query?
If I wanted to get parent ID 1 and all of the children for the parent how could I use "Bob", "Smith" and "Jack" in the query to get parent ID 1, but not parent ID 2.
Edit: I don't think this is a duplicate because the other question's solution would match both parent ID 1 and 2, due to them having the same children apart from 1