Re: [GENERAL] aggregates and case statements

2008-11-17 Thread Richard Huxton
[EMAIL PROTECTED] wrote: > Quoting Richard Huxton <[EMAIL PROTECTED]>: >> But I'm guessing that's not what you mean. Can you show what output >> you'd like to have? > > effort sum > 1 245 > 2 463 > etc. > > Each value for effort has a different statistical meaning as in the case > state

Re: [GENERAL] aggregates and case statements

2008-11-17 Thread Richard Huxton
Garry Saddington wrote: > Is there a way to make the following statement return the total of all > effort. At the moment it gives a list of sum vs case. > > > select sum(effort), > CASE WHEN effortandattainment.effort=5 THEN -3 > WHEN effortandattainment.effort=4 THEN -2 > WHEN effortandattainm

[GENERAL] aggregates and case statements

2008-11-16 Thread Garry Saddington
Is there a way to make the following statement return the total of all effort. At the moment it gives a list of sum vs case. select sum(effort), CASE WHEN effortandattainment.effort=5 THEN -3 WHEN effortandattainment.effort=4 THEN -2 WHEN effortandattainment.effort=3 THEN 1 WHEN effortandattain