Answer the question
In order to leave comments, you need to log in
Retrieve data from table A that does not match the data in table B?
Hello everyone, can you help?
I have two tables, table A and B.
Table A stores the names of songs in the shortcode field.
Table B contains the name of the song in the musicname field and the id of the song from table A in the id_task field, as well as the user id in the id_user field.
Question: How can I display data from table A that does not match the data in table B. That is:
A.id != B.id_task AND B.id_user != $id_user
Answer the question
In order to leave comments, you need to log in
It's decided.
SELECT *
FROM A
WHERE NOT EXISTS (SELECT * FROM B WHERE A.id = B.id_task)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question