Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 496
  • Last Modified:

To find the count of rows returned by minus in oralce

hi,

select * from a
minus
select * from b

here how to find the no. of rows returned by the above query.

thanks in advance

Regards

S.Djeanthi
0
djeanthi
Asked:
djeanthi
  • 2
1 Solution
 
LowfatspreadCommented:
have you tried

select count(*) from (
select * from a
minus
select * from b
) as C


?
0
 
LowfatspreadCommented:
you could also restructure the query to use not exists

e.g.

select count(*)
 from a
 where not exists (select * from b
    where a.primary key = b.primary key)
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now