SQL语言基础

来源:互联网 发布:抗美援朝有必要吗 知乎 编辑:程序博客网 时间:2024/04/30 15:08

1.集合的操作:
UNION:将多个查询结果相加形成一个结果集。将第一个查询中的所有行与第2个查询中的所有行相加,并消除其中相同的行形成一个集合。

INTERSECT:处理多个查询结果的交集。

2.添加/删除字段:alter table user add pwd varchar2(10);
alter table user drop column pwd;

3.授权/回收授权语句:
1)只读权限:grant select on table tableName to user;

2)表的所有操作权限: grant all privileges on table table1,table2 to user;
回收授权:revoke select on table table1,table2 to user;

3)授权给所有用户:grant select on table tableName to public;
回收授权:revoke select on table tableName to public;

4)修改某个字段的权限:grant update(id),select on table tableName on user;
回收授权:revoke update(id),select on table tableName to user;

5)授权给user用户,并允许他授权给其他用户:grant select on table tableName to user with grant option;
回收授权:revoke select on table table1,table2 to user;

0 0