Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. please help me to hw the output of the belw statement is 1200?

please help me to hw the output of the belw statement is 1200?

Scheduled Pinned Locked Moved Database
questiondatabasehelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pashitech
    wrote on last edited by
    #1

    What is the output of the following query SELECT TRUNC(1234.5678,-2) FROM DUAL; i came to knw the answer as 1200 hw?

    S D 2 Replies Last reply
    0
    • P pashitech

      What is the output of the following query SELECT TRUNC(1234.5678,-2) FROM DUAL; i came to knw the answer as 1200 hw?

      S Offline
      S Offline
      shally_79
      wrote on last edited by
      #2

      If places is positive, number is truncated to places decimal places. If places is negative, number is truncated on the left of the decimal point so in ur case the number on the left of the decimal point is 1234 -2 = Number of decimal places used for truncating so u have to truncate 1234 for two places that means 1200

      sdf

      1 Reply Last reply
      0
      • P pashitech

        What is the output of the following query SELECT TRUNC(1234.5678,-2) FROM DUAL; i came to knw the answer as 1200 hw?

        D Offline
        D Offline
        Dave Herren
        wrote on last edited by
        #3

        I believe the following is correct: SELECT TRUNC(1234.5678, 2) = 1234.5600 SELECT TRUNC(1234.5678, 1) = 1234.5000 SELECT TRUNC(1234.5678, 0) = 1234.0000 SELECT TRUNC(1234.5678, -1) = 1230.0000 SELECT TRUNC(1234.5678, -2) = 1200.0000 Seeing a pattern yet?

        topcoderjax - Remember, Google is your friend.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups