Re: Sum a Union Query
From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 10/24/04
- Previous message: Newbie: "Re: Sum a Union Query"
- In reply to: Newbie: "Re: Sum a Union Query"
- Next in thread: news.microsoft.com: "Re: Sum a Union Query"
- Reply: news.microsoft.com: "Re: Sum a Union Query"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 24 Oct 2004 22:27:28 +0200
On Sun, 24 Oct 2004 16:37:14 +0100, Newbie wrote:
>What I want to know is how to do the sum part on a union query?
Hi,
The genral format is something like this:
SELECT xxx, yyy, SUM(zzz), SUM(qqq)
FROM (SELECT xxx, yyy, zzz, qqq
FROM ....
WHERE ....
UNION [ALL]
SELECT xxx, yyy, zzz, qqq
FROM ....
WHERE ....) AS d(xxx, yyy, zzz, qqq)
GROUP BY xxx, yyy
If you need more specific help, re-read my previous message indicating
what information you should post to enable me to help you.
Best, Hugo
-- (Remove _NO_ and _SPAM_ to get my e-mail address)
- Previous message: Newbie: "Re: Sum a Union Query"
- In reply to: Newbie: "Re: Sum a Union Query"
- Next in thread: news.microsoft.com: "Re: Sum a Union Query"
- Reply: news.microsoft.com: "Re: Sum a Union Query"
- Messages sorted by: [ date ] [ thread ]