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