Pairwise and Non-Pairwise Comparisons

Explain the difference between pairwise and non-pairwise comparisons in multiple column sub-queries.

Questions by vamsivishwa

Showing Answers 1 - 2 of 2 Answers

yogesh.raut

  • Mar 13th, 2010
 

Pairwise means we can put two checks at a time using subquery using ' in ' condition..
Non pairwise mean seprately we have to specifiy subquery for both conditons using equality operator.

  Was this answer useful?  Yes

pravintule

  • May 28th, 2010
 

In pairwise comparison the attributes included in where clause predicate are compered
in same predicate and only single predicte is evaluated.where as in non-pairwise comparison the attributes are compared seperately and multiple predicates are evaluated.

For example:

Pairwise comparison:
Select e.empname,e.salary,e.designation,e.deptno from emp e where(e.deptno,e.salary) in (select e1.deptno,max(e1.salary) as salary from emp e1 where designation='manager' group by deptno)

Non pairwise comparison:
Select e.empname,e.salary,e.designation,e.deptno from emp e where e.deptno in(select deptno from emp e1 where designation='manager' group by deptno) and e.salary in(select max(e2.sal) from emp e2 where e2.designation='manager' group by deptno)

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions