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

Home -> Community -> Usenet -> c.d.o.server -> Using union and count

Using union and count

From: Jiten <jiten_vaja_at_bigfoot.com>
Date: 5 Feb 2004 09:51:06 -0800
Message-ID: <25491684.0402050951.3aa99ef9@posting.google.com>


I need some help, I'm trying to query a distributed database to count a number of rows and give me a total, i've got the following code, i'm using sql in oracle:

SELECT COUNT(Opponent) FROM databaseA_at_databaseAlink WHERE Opponent =
'A' AND Date > SYSDATE UNION

SELECT COUNT(Opponent) FROM databaseB_at_databaseBlink WHERE Opponent =
'B' AND Date > SYSDATE UNION

SELECT COUNT(Opponent) FROM databaseC_at_databaseClink WHERE Opponent =
'C' AND Date > SYSDATE UNION

SELECT COUNT(Opponent) FROM databaseD_at_databaseDlink WHERE Opponent =
'D' AND Date > SYSDATE;

When this is run I get a Opponent with a count of 0 and 1.

Any help is much appreciated Received on Thu Feb 05 2004 - 11:51:06 CST

Original text of this message

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