change datatype of a view
758466Mar 11 2010 — edited Mar 11 2010Hi all,
Is there any method to change the datatype of a view.
create table t(
tot number(6,3),
name char(1)
);
SQL> desc t;
Name Null? Type
----------------------------------------- -------- ----------------
TOT NUMBER(6,3)
NAME CHAR(1)
SQL> create view r as
2 select avg(tot) as avg from t;
SQL> desc r;
Name Null? Type
----------------------------------------- -------- -----------------
AVG NUMBER
I want to convert the datatype of avg from number to number(6,3). How can i do it? Suppose if the ave obtained is 7.66666666, then i should be able to display only 7.66