My scenario is as follows:
IhavetheActivitytable
I need to mount a select, taking the values from the queue table, but I need to exclude from the queue the values that already exist in the activity table. If in the activity table there is already URL 976 and USER 96, then on select it would skip this line. Based on the image, the select of the queue would return only the IDs 975 and 973
I tried this, but did not:
SELECT *
FROM fila f
WHERE NOT EXISTS
(
SELECT NULL FROM atividade a
WHERE a.url = f.idlinks
AND a.usuario = f.usuario
AND a.url = f.idlinks and a.usuario = 96
)
Thank you in advance, thank you.