I am trying to write a SQL statement that selects data out of a table where an individual has multiple values in the same column. For example, based on the table below: I need a query to select all of the rows for all of the individuals who have both a bat and a baseball in the “Toy” column.
------------------------
| ID | Name | Toy |
------------------------
| 1 | Jack | Bat |
| 2 | Jim | Baseball |
| 3 | Jack | Baseball |
| 4 | John | Bat |
| 5 | Jim | Football |
| 6 | Jack | Glove |
------------------------
I would like the results to be something like:
-------------------
| Name | Toy |
-------------------
| Jack | Bat |
| Jack | Baseball |
-------------------
I hope this makes sense. Thanks.