|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
I would like to use the Sum function for a page which shows orders in the database.
I use the following: "Select Location, (Sum)OrderTotal from Orders Group by Location" and get a very long string of numbers. The same phrasing works with Count but not with AVG or Sum. The OrderTotal field is decimal type. Does anyone know why this isn't working or have suggestions about getting a total? Thanks. |
|
#2
|
|||
|
|||
|
The Syntax is wrong, Sum should not be in brackets (I dont know if you meant to do this). The syntax should be:
Select Sum(Order) instead. Apart from that - it should work fine. Make sure the column you are summing, is a number type. |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Using Sum function gets odd results |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|