Answered Questions

  • What is the difference between ROUND and TRUNC function in SQL? ">

    What is the difference between ROUND and TRUNC function in SQL?

    Both TRUC and ROUND are single value functions. TRUNC: TRUNC function truncates that is in other words cuts off to the digits specified. The general syntax of TRUNC function is: TRUNC(number, precision); For instance: Suppose the value of salary in employee table for ename= ’Exforsys’ is 55.666 Then Select TRUNC(salary,2) from employee where ename=’Exforsys’;...

    s.siva karthik

    • Sep 29th, 2011

    SQL> select ceil(14.1) ,round(14.1),ceil(14.01),round(14.4),trunc(14.6) from dual; CEIL(14.1) ROUND(14.1) CEIL(14.01) ROUND(14.4) TRUNC(14.6) ---------- ----------- ----------- ...

    avatar

    • Sep 10th, 2011

    Round function will increase the value by 1 if decimal value is greater than or equal to 5 else it will return same integer value without decimal ex. select round(8.34) from dual; will return 8; sel...