I am trying to subtract the results of the following two SQL queries and am unable to figure it out. I have tried NOT IN
and EXCEPT
but I think I am doing it incorrectly. Here are my queries:
SELECT DISTINCT first_name, last_name, rating, email, phone
FROM users
WHERE rating !='6';
SELECT DISTINCT first_name, last_name, rating, email, phone
FROM users
JOIN user_transactions
ON users.id=user_transactions.user_id
WHERE rating != '6' AND created_on >= '2014-09-01' AND created_on <= CURDATE();