Solved

To find the count of rows returned by minus in oralce

Posted on 2004-03-27
2
492 Views
Last Modified: 2008-03-03
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
Comment
Question by:djeanthi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 50

Accepted Solution

by:
Lowfatspread earned 25 total points
ID: 10697607
have you tried

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


?
0
 
LVL 50

Expert Comment

by:Lowfatspread
ID: 10697613
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

Get Database Help Now w/ Support & Database Audit

Keeping your database environment tuned, optimized and high-performance is key to achieving business goals. If your database goes down, so does your business. Percona experts have a long history of helping enterprises ensure their databases are running smoothly.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating and Managing Databases with phpMyAdmin in cPanel.
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question