Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Android Security Essentials Live Lessons
this week in the
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
How to use Airthmetic operator in Hibernate query
wait() and notify() methods ragarding threads.
Is Composite pattern appropriate ?
jasper - ireport - sum
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