You are here: SQL Problem « PHP SQL « IT news, forums, messages
SQL Problem

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-----

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация