I was able to determine the list of actors that have been in movies with 'Kevin Bacon' and get rid of the duplicates with DISTINCT; however, I cannot figure out how to exclude 'Kevin Bacon' from the list of actors.
Here is the SQL code I have so far that gives me a list of 177 actors including 'Kevin Bacon.
SELECT DISTINCT(name) FROM people WHERE id IN
(SELECT person_id FROM stars Where movie_id IN
(SELECT movie_id FROM stars Where person_id IN
(SELECT id FROM people WHERE name IS 'Kevin Bacon' and
(SELECT id FROM people WHERE birth = 1958))))
ORDER BY name
I have tried using NOT, LIKE, IS, = and a few other terms in the ORDER BY area and all I get is his name at the top or bottom of the list.
I have tried inserting NOT, NOT LIKE, IS NOT, NOT =, != 'Kevin Bacon' in various ways with the above Keywords in the first SELECT DISTINCT name; after WHERE id; after Where person_id; and after the original name IS 'Kevin Bacon' but, nothing seems to remove his name from the list.
I have also googled many versions of remove name or item for SQL list and have not found any information there that corresponds to this issue.
If anyone has any ideas, please let me know. I am now attempting to change the whole code and add another row of [SELECT id FROM people WHERE name IS NOT 'Kevin Bacon'; but as I am getting the correct list with 177 names I am reluctant to tear i apart and start from scratch.
I have also reviewed the KEYWORDS and tried to use CASE CASE WHEN 'Kevin Bacon' IN DISTINCT(Name) THEN name NOT LIKE 'Kevin Bacon' END but could not find a method to insert it into the current code without syntax issues.
I've been on this for days now and little frustrated as to how removing an item from a list you want to devise can be so difficult or how little info can be found about this with my resulting google searches. Thanks in advance.