Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2007
    Posts
    42

    Unanswered: 2 decimal places

    DB ESE
    SELECT AVG(COLUMN)
    FROM TABLE

    i have this query. i have assigned column with datatype decimal(9,2). but when it produces result, it has a lot of decimal places. i tried rounding but it gives unnecessary zeros and doesn't even follow the 2 decimal places. i've read about formatting.. i tried them but doesn't work.. i should be missing something! pls help!

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    SELECT cast(AVG(salary) as decimal(9,2)) FROM emp
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Feb 2007
    Posts
    42
    oic.. now, i understand! tnx a lot

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •