My table people_jobs:
+--------+--------+
| NAME | JOB |
+--------+--------+
| John | Actor |
+--------+--------+
| Jane | Driver |
+--------+--------+
| Bill | Actor |
+--------+--------+
| John | Cook |
+--------+--------+
I'm looking to select all names with the job actor where the name column would be unique. The desired query output here would be just Bill.
Something like:
SELECT name FROM people_jobs WHERE job LIKE "actor" AND COUNT(SELECT * FROM people_jobs WHERE name LIKE name) = 1;
This is apparently bad syntax and I couldn't get GROUP BY to work... Thoughts?
SELECT distinct name FROM people_jobs WHERE job='actor'Something like that?