• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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?

Master Rancher
Posts: 4668
  • 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.
    Bookmark Topic Watch Topic
  • New Topic