In my website, I have a users table, primary key is username
. I have an albums table with an album id and an album title. I have also a table user_albums that models the relationship of many users like many albums.
This is a select query that returns the albums a particular user likes:
SELECT e.album_title
FROM user_albums d
INNER JOIN albums e ON d.album_id = e.album_id
WHERE d.user_id = $user
What I want is the same query, but I want it to return all the albums he does not like. So basically, select all albums not in that query.
What would I need to change to do this?