zoukankan      html  css  js  c++  java
  • SQL Server 视图

    1.视图就是由一个查询所定义的虚拟表

    2.用视图的好处

      1)为最终用户减少数据库呈现的复杂性。

      2)防止敏感的列被选中,同时仍然提供对其他重要数据的访问;

      3)对视图添加一些额外的索引,来提高查询的效率;

    3.创建视图

    if(exists(select * from sys.objects where name='视图名称'))
    
    drop view 视图名称
    
    go 
    
    Create view view_demo
    
    as 
    
    select top 20 * from 表名  或者 select '名称'=name... from 表名
    
    go
    
    
    4.修改视图
    
    alter  view view_demo
    
    as 
    
    select top 20 * from 表名  或者 select '名称'=name... from 表名
    
    go
    将来的你,一定会感谢现在努力的自己!
  • 相关阅读:
    人物-商界-张近东:张近东
    人物-商界-许家印:许家印
    iptables-save
    iptables-restore
    iptables
    ipcs
    ipcclean
    ipc
    ip
    install-info
  • 原文地址:https://www.cnblogs.com/GreatPerson/p/SQL.html
Copyright © 2011-2022 走看看