I don't know how I missed that...but I'm still getting an error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * from john_doe_rentals)' The john_doe_rentals should look like:
+-----+
| bid |
+-----+
| 2 |
| 5 |
+-----+
and the sailors_rentals should be:
+----------------------+-----+
| name | bid |
+----------------------+-----+
| Captian KirK | 2 |
| Jane Doe | 2 |
| Johnny Rocket | 2 |
| Jane Doe | 5 |
+----------------------+-----+
My goal is to use whats in john_doe_rentals to get only those names that have rented every boat he has from sailors_rentals. So with this small dataset it would be:
+----------------------+
| name |
+----------------------+
| Jane Doe |
+----------------------+
because she is the only one who has rented every boat John Doe has.
I'm really avoiding any other tools, I'd like to understand what exactly is going on and be able to write the SQL statements myself. I have to think this is probably a good time to use a join query, but I can't figure it out. The other thing I thought of would be to concat every bid in john_doe_rentals with a space, and do the same thing in sailor_rentals. to get something like:
+-----+
| bids |
+------+
| 2 5 |
+------+
+----------------------+------+
| name | bids |
+----------------------+------+
| Captian KirK | 2 |
| Jane Doe | 2 5 |
| Johnny Rocket | 2 |
+----------------------+------+
but then it comes down to making sure things are sorted correctly so I don't get '5 2' and I see it getting ugly fast. There's gotta be simple query to do what I'm try to achieve.