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!

How Does MINUS Work?

SaurabhKJan 5 2010 — edited Jan 5 2010
Hi,

I want to do a count(*) table 1 minus count(*) table 2 in a test case. How does minus work in functions?
create table count1( col1 number);
create table count2( col2 number);

truncate table count1;
truncate table count2;
insert into count1 values(1);
insert into count1 values(2);
insert into count1 values(3);
insert into count1 values(4);
insert into count1 values(5);
commit;
insert into count2 values(1);
insert into count2 values(2);
insert into count2 values(3);
insert into count2 values(5);
commit;
SQL> select * from count1
  2  minus
  3  select * from count2;

      COL1
----------
         4

SQL> 
SQL> select count(*) from count1
  2  minus
  3  select count(*) from count2;

  COUNT(*)
----------
         5

SQL> 
This post has been answered by Karthick2003 on Jan 5 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 2 2010
Added on Jan 5 2010
4 comments
6,039 views