A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
video training course this week in the
JDBC and Relational Databases
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
crystal report using sql server db
jasper - ireport - sum
wait() and notify() methods ragarding threads.
How to use Airthmetic operator in Hibernate query
Is Composite pattern appropriate ?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015