• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Sum of Decimal confusion

Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have a DB column of decimal type decimal(5,2) in mysql database

Now i want to display the sum of the values...i'm using JOOQ

i tried the following

# select sum(col) ---> returns integer value - no decimal
# select round(sum(col), 2) --> returns the value. however it rounded off the value

Links referred for reference

I'm not sure how to fix this. Can someone help me on this?

Posts: 4588
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post some actual examples, of the rows being summed and the output from each of those queries.
No more fooling around. Read this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic