25.67,-1
Trunc = 20
Round= 30

HOW????

Answers were Sorted based on User's Feedback



25.67,-1 Trunc = 20 Round= 30 HOW????..

Answer / chandu

select trunc(25.67,-1),round(30) from dual;

TRUNC(25.67,-1) ROUND(30)
--------------- ----------
20 30

Is This Answer Correct ?    3 Yes 3 No

25.67,-1 Trunc = 20 Round= 30 HOW????..

Answer / gaurav

The TRUNC (n1, n2) function returns n1 truncated to n2 decimal places. If n2 is omitted, then n1 is truncated to 0 places. n2 can be negative to truncate (make zero) n2 digits left of the decimal point.

if you do it -2. answer will be zero in this case.

similar thing goes for round.It will become zero.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More SQL PLSQL Interview Questions

what is 'mysqldump'? : Sql dba

0 Answers  


Explain the difference in execution of triggers and stored procedures?

0 Answers  


Hi Guys, I have a situation where I need to access the column values from rowtype variable. However, the column names are dynamic. below is sample code: declare Cursor c1 is select * from emp; Cursor c2 is select column_name from xyztable; v_c2 c2%rowtype; v_str varchar2 v_value varchar2(200); begin for rec in c1 loop open c2;---this cursor has column names like EMPLOYEE_ID, FIRST_NAME, LAST_NAME etc. loop fetch c2 into v_c2; exit when c2%notfound; /* now lets say i want to access value of LAST_NAME from cursor c1, so I am writing below code, however it does not work as expected */ v_str:= 'rec.'|| v_c2.column_name; -- this will give me string like "rec.EMPLOYEE_ID" v_value:=v_str; end loop; end loop; end; / Plz help ASAP.Thanks.

2 Answers  


How do I view a sql database?

0 Answers  


how many sql ddl commands are supported by 'mysql'? : Sql dba

0 Answers  






What is the life of an sql statement?

0 Answers  


How to Declare Fixed Length String Value In PL SQL

0 Answers  


What is pls integer?

0 Answers  


What is the difference between left join and right join?

0 Answers  


how to create object in plsql

2 Answers   TCS,


How do you drop a trigger?

0 Answers  


Write a query to find the name of employees those who have joined on Monday.(based on column hire_date)

15 Answers   Satyam,


Categories