oracle SQL

need help with the below query:

expected result:
all value in table "s" that is not in table "o"

select s.*, o.*
  from dba_test.databases              d,
       dba_test.db_parameters_std      s,
       dba_test.db_param_trig_override o
 where d.p_version like s.e_version || '%'
   and o.db_instance = 3629
   and d.instance = o.db_instance
   and s.owner <> 'ALL'
eagle_eaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

eagle_eaAuthor Commented:
table "S" has records
1 a
2 b
3 b

table "o" has records
1 a
2 b

the result expected is
3 b
0
slightwv (䄆 Netminder) Commented:
Not sure where the original select you posted came from but the example data doesn't seem to match it.

To find the differences between two tables a simple MINUS should work.

select * from tableS
minus
select * from tableO
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
eagle_eaAuthor Commented:
tableS and table O has other values, the 1st query i said contains more conditions to the query. does minus work when there are other tables mixed in the condition?
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

slightwv (䄆 Netminder) Commented:
I do not understand.

Please post actual sample data and expected results.
0
sdstuberCommented:
SELECT s.*
  FROM dba_test.databases d, dba_test.db_parameters_std s
 WHERE d.p_version LIKE s.e_version || '%'
   AND s.owner <> 'ALL'
   AND NOT EXISTS
               (SELECT NULL
                  FROM dba_test.db_param_trig_override o
                 WHERE AND o.db_instance = 3629
                   AND d.instance = o.db_instance
                   AND s.col1 = o.col1 -- use whatever columns produce the 1,2,3 in your example
                   AND s.col2 = o.col2 -- use whatever columns produce the a,b in your example
                                      )
0
eagle_eaAuthor Commented:
yes, that is correct
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.