SQL: To get a count result, use the SET operator.

Started by Mobo01, November 08, 2022, 11:20:51 PM

Previous topic - Next topic


In SQL Developer, I'm attempting to acquire a count result by using the SET operator.

I need to determine how many instances of "attribute1" exist in "table name1" but not in "table name2."

Essentially, I want the same result as the following query, but with a SET operator.
[code]SELECT count(distinct <attribute1>)
FROM <table_name1>
WHERE <attribute1> IS NOT (SELECT <attribute1>
                           FROM <table_name2>);

I've looked through many Oracle https://docs.oracle.com/cd/B19306_01/server.102/b14200/operators005.htm">manuals and other internet https://www.scaler.com/topics/sql/set-operators-in-sql/">directories but haven't found satisfactory answers; could somebody kindly assist me?