>>>>> "Olaf" == Olaf Zanger <[EMAIL PROTECTED]> writes:
Olaf> hi there i'd like to add up the "true" values of a
Olaf> comparison like
Olaf> sum(a>b)
Olaf> it just doesn't work like this
Olaf> any workaround
Try using a case statement:
select sum(case when a > b then 1 else 0 end) ....
-Dan
- [SQL] sum(bool)? Olaf Zanger
- Re: [SQL] sum(bool)? Peter Eisentraut
- Re: [SQL] sum(bool)? Daniel Wickstrom
- Re: [SQL] sum(bool)? Andrew Perrin
- Re: [SQL] sum(bool)? Tod McQuillin
- Re: [SQL] sum(bool)? Olaf Zanger
- [SQL] sum(bool)? Olaf Marc Zanger
- Re: [SQL] sum(bool)? Oliver Elphick
- Fwd: Re: [SQL] sum(bool)? J.Fernando Moyano
- Re: Fwd: Re: [SQL] sum(bool)? D'Arcy J.M. Cain
