25.67,-1
Trunc = 20
Round= 30
HOW????
Answers were Sorted based on User's Feedback
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 |
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 |
what is 'mysqldump'? : Sql dba
Explain the difference in execution of triggers and stored procedures?
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.
How do I view a sql database?
how many sql ddl commands are supported by 'mysql'? : Sql dba
What is the life of an sql statement?
How to Declare Fixed Length String Value In PL SQL
What is pls integer?
What is the difference between left join and right join?
how to create object in plsql
How do you drop a trigger?
Write a query to find the name of employees those who have joined on Monday.(based on column hire_date)