数据库——Oracle——增删改查(基础)

来源:互联网 发布:作弊大师软件下载 编辑:程序博客网 时间:2024/06/13 22:48

select 字段名 

from 表名

where 条件

group by 字段名

order by ;


create table 表名( 字段名 数据类型(长度),字段名 数据类型(长度) ); --创建表

create table 表名 as (select....);    --拿来当备份


insert into 表名 (字段名1,字段名2) value (值1,值2); --插入行数据,必须要括号


alter table 表名 add 字段名 数据类型(长度);   --创建字段

alter table 表名 modify (字段名 数据类型(长度) ); --修改字段类型、长度,需要字段没有数据才行

alter table 表名 rename to 新名;                      --修改表名

alter table 表名 rename column 字段原名 to 字段新名;--修改字段名

alter table 表名 drop 字段名;                            --删除字段


delete [from] 表名 where 条件; --删除行数据

drop table 表名;            --删除表,进回收站

drop table 表名 purge; --删除表,不进入回收站    



参考内容:http://bbs.csdn.net/topics/280056496

http://blog.163.com/net_cwp/blog/static/18294003520111130105122391/





0 0
原创粉丝点击