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
djeanthiAsked:
Who is Participating?
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.