Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Using union and count
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
![]() |
![]() |