Posted by Chris Blackburn on 06/14/05 13:29
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I have a table with 3 columns:-
LAPS (INT) - Number of Laps completed
ESTIMATE (INT) - Estimated sponsorship
PERLAP (BOOL) - Is the above sponsorship per lap or in total.
What I need is to estimate total sponsorship. So sum ESTIMATE when
PERLAP is false but sum ESTIMATE * LAPS if PERLAP is true. I guess it is
something to do with a CASE statement but I am new to all this SQL and I
can't get my head around it :)
Thanks
- --
Chris Blackburn
E-Mail: cblackburn36NOSPAM@softhome.net
E-Mail: cblackburn36@NOSPAMgmail.com
PGP Public Key: http://makeashorterlink.com/?C2AF31929
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCrrGlxsNEmi5WofsRAuDiAJ4ilrwi6FQREe5Mzz8yRngARp4glACfU0lh
lTuWp0pSPdUflRIflvpTzBA=
=5FZ6
-----END PGP SIGNATURE-----
[Back to original message]
|