Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Count with Intersect, Union, etc.

Count with Intersect, Union, etc.

From: Ryan Rucker <rxruck2_at_uswest.com>
Date: 1998/03/27
Message-ID: <351BD155.A068FD96@uswest.com>#1/1

Hello,

Is it possible to do a "select count(*)..." kind of query with an intersect or union?

Here's what I'm looking for:

    select order_number from customers intersect select order_number from orders;

While this returns the values I'm looking for, I'd rather just have a count. If this is possible, how is it done?

I've tried things like:

     select count(order_number) from customers intersect select count(order_number)

     from orders;

but I just get "no rows selected."

I've glanced through Oracle: The Complete Reference and didn't see anything, and I've also looked through the archives at DejaNews.

Thanks,

Ryan Received on Fri Mar 27 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US