Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Pairwise e Non-Pairwise Comparison

733971Nov 12 2009 — edited Nov 12 2009
Hi,
I am from Italy... I hope my English is the most correct as possible.

I am studing Oracle bases.

I think I have understood differences between Pairwise comparison e Non pairwise comparison. But I don't have the table so I don't understand the example in the Oracle book:

NON PAIRWISE COMPARISON SUBQUERY:
SELECT employee_id, manager_id, department_id
  FROM employees
 WHERE manager_id IN
            (SELECT manager_id
               FROM employees
              WHERE first_name = 'John')
   AND department_id IN 
            (SELECT department_id
               FROM employees
              WHERE first_name = 'John')
   AND first_name != 'John';
PAIRWISE COMPARISON SUBQUERY:
SELECT employee_id, manager_id, department_id
  FROM employees
 WHERE (manager_id, department_id) IN
              (SELECT manager_id, department_id
                 FROM employees
                WHERE first_name = 'John')
   AND first_name != 'John';
When those queries return some values?

Thanks for the help.

P.S.: I don't manage to do the symbol of "different" -> "<.>"

Edited by: user10992983 on 12-nov-2009 3.36
This post has been answered by John Spencer on Nov 12 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 10 2009
Added on Nov 12 2009
14 comments
6,179 views