A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
SUM using two attributes
Joined: Dec 20, 2010
Jun 30, 2011 13:11:19
My table has two columns amount and amountEstimated.
I would like to get a sum of the money using following logic.
If (amount == null) use amountEstimated
Else use amount.
How do I write a SQL for this?
Thanks so much for your help
Joined: Oct 14, 2005
Jun 30, 2011 14:18:24
That depends on what database you are using. Here is
which gives examples for a couple of the more common databases.
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
subject: SUM using two attributes
jasper - ireport - sum
Is Composite pattern appropriate ?
crystal report using sql server db
How to use Airthmetic operator in Hibernate query
wait() and notify() methods ragarding threads.
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014