oracle 视图创建 视图及字段加注释 字段数据类型更改

1.视图创建

create or replace view user.v_users as 
select id,
		name,
		age,
		sex
	from users

2.视图注释

comment on table user.v_users is '用户视图';

3.视图字段注解

comment on column user.v_users.id is '用户ID';
comment on column user.v_users.name is '用户姓名';
comment on column user.v_users.age is '用户年龄';
comment on column user.v_users.sex is '用户性别';

4.视图字段数据类型更改

create or replace view user.v_users as 
select  cast(id as integer) as id,
		cast(name as varchar2(20)) as name,
		age,
		sex
	from users;

你可能感兴趣的:(oracle,oracle)