• Orcal创建视图


    一、创建视图

    drop view srv_kims_zt_tablename;--删除视图避免重复
    --创建视图开始
    create or replace view srv_kims_zt_tablename  as
    select 
        z.id as column1,
        z.name as column2,
        z.age as column3,
        to_date(z.busidate,'yyyy-MM-dd hh24:mi:ss') AS column4,
        f.class as column5
      from zt_tablename z 
      --from databasename.zt_tablename z --如果是不同的库前面要加库名
      inner join tablename1 f on f.fid = z.id
      where f.publishstatus = '1' and f.enddate is null
      and z.busidate > '20200904'
      order by z.fundcode,z.busidate
    with read only;--只读
    --添加注释
    comment on table srv_kims_zt_tablename  is '某某视图';
    comment on column srv_kims_zt_tablename.column1 is '编号';
    comment on column srv_kims_zt_tablename.column2 is '姓名';
    comment on column srv_kims_zt_tablename.column3 is '年龄';
    comment on column srv_kims_zt_tablename.column4 is '日期';
    comment on column srv_kims_zt_tablename.column5 is '班级';

    二、使用视图

    select * from srv_kims_zt_tablename;
  • 相关阅读:
    Nginx详解
    MySQL数据库(未完)
    PXE自动装机
    Rsync数据同步服务
    NFS网络文件系统
    inotify事件监控工具
    scp ssh-key连接原理
    生产环境ssh登陆策略
    npm ERR! errno -4048
    js判断手机系统语言动态引入不同js文件
  • 原文地址:https://www.cnblogs.com/zeussbook/p/13803634.html
Copyright © 2020-2023  润新知