Re: Discoverer: Comparing a sum with a fixed value

From: Stephan Langer <slanger_at_dixi-wc.de>
Date: Fri, 09 Feb 2001 11:11:04 +0100
Message-ID: <3A83C238.AF22A8C9_at_dixi-wc.de>


Hi,

use group by and having-clause:

select id, date, sum(value) from table_name where account in(100,900) group by id, date
having sum(value) > 1000

hth
Stephan

Lars Reineke schrieb:

> Hi,
>
> I'm desperately looking for some help on this issue.
>
> I've got a table which looks like this (simplified):
> id number(5)
> date date
> account number(3)
> value number(4)
>
> Example:
> 39005 01.02.2001 100 700
> 39005 01.02.2001 900 25
> 40001 01.02.2001 100 713
> 39005 02.02.2001 100 925
> 39005 02.02.2001 900 95
> 40001 02.02.2001 100 856
> 40001 02.02.2001 900 30
> .
> .
> .
>
> Now I want to find out, where (which ID on which date) the values with
> account numbers '100'+'900' are together greater then 1000.
>
> I already built up a Discoverer crosstable, where the sums of account
> 100 + account 900 are shown.
>
> It looks like this:
> date id 100 900 sum
> 01.02.2001 39005 700 25 725
> 01.02.2001 40001 713 0 713
> 02.02.2001 39005 925 95 1020 <- This one!
> 02.02.2001 40001 856 30 886
> .
> .
> .
>
> But I don't know how to compare these sums with the fixed value of
> 1000.
>
> Can you help me?
>
> cu
> Lars Reineke
  Received on Fri Feb 09 2001 - 11:11:04 CET

Original text of this message