Re: Sum a Union Query
From: news.microsoft.com (noidea_at_nospam.com)
Date: 10/25/04
- Next message: mike: "Get the smallest timespan between two entries"
- Previous message: Hugo Kornelis: "Re: Sum a Union Query"
- In reply to: Hugo Kornelis: "Re: Sum a Union Query"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 25 Oct 2004 14:19:58 +0100
Thanks this is just what I was looking for
"Hugo Kornelis" <hugo@pe_NO_rFact.in_SPAM_fo> wrote in message
news:0t3on0t4us3dhm7s1is584umrbrccfqc98@4ax.com...
> 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)
- Next message: mike: "Get the smallest timespan between two entries"
- Previous message: Hugo Kornelis: "Re: Sum a Union Query"
- In reply to: Hugo Kornelis: "Re: Sum a Union Query"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|