1

I have 2 tables in a Oracle database and if I do:

SELECT ID,ID_EXTERN_FOR_JOB FROM SOL_PUBLIC.SOL_SUBSOL_CHESTIONARE@RACDB
WHERE ID=1207;

I get:

ID      ID_EXTERN_FOR_JOB
1207    -1

On the other table, if I do:

SELECT ID,ID_EXTERN_FOR_JOB FROM SOL.SOL_SUBSOL_CHESTIONARE
WHERE ID_EXTERN_FOR_JOB=1207;

I get

ID      ID_EXTERN_FOR_JOB
2009    1207

And I want to find out all the rows that don't match this "rule" of having the ID_EXTERN_FOR_JOB from SOL in ID FROM SOL_PUBLIC and I don't know how to do that. Thanks!

1 Answer 1

1

Try this one:

SELECT  PRIV.id_extern_for_job
,       PRIV.id
,       PUB.id_extern_for_job
FROM    SOL_PUBLIC.SOL_SUBSOL_CHESTIONARE@RACDB     PUB
,       SOL.SOL_SUBSOL_CHESTIONARE                  PRIV
WHERE   PRIV.id_extern_for_job = PUB.id
AND     PRIV.id <> PUB.id_extern_for_job;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.