日期:2014-05-17 浏览次数:20932 次
create view as select to_number(nvl(person_no,0)) from tb
------解决方案--------------------
create table person( p_no varchar2(5), pname varchar2(20), sex char(1), age number(3), address varchar2(50)); SQL> select * from person ; P_NO PNAME SEX AGE ADDRESS ----- -------------------- --- ---- -------------------------------------------------- 1001 James M 56 Mexco--P_NO左对齐,说明是字符类型 1002 Scott F 22 Tokyo 1003 Smith M 18 Beijing 1004 yeeXun M 22 China 1005 Lili -- create view view_person as select to_number(nvl(p_no,0)) p_no,pname,age from person; SQL> select * from view_person; P_NO PNAME AGE ---------- -------------------- ---- 1001 James 56--P_NO右对齐,说明是number类型 1002 Scott 22 1003 Smith 18 1004 yeeXun 22 1005 Lili