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.
I agree. Here's the link:
subject: SUM using two attributes
How to use Airthmetic operator in Hibernate query
Is Composite pattern appropriate ?
jasper - ireport - sum
wait() and notify() methods ragarding threads.
crystal report using sql server db
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014