oracle / sql 简单语句
2013-04-07 19:09
253 查看
oracle sql 简单语句
创建数据库: create database dbname;
1.创建表: create table (l列名 类型,...);
2.修改表名: alter table 表名 rename to 新表名;
3.添加列: alter table 表名 add 列名 类型;
4.修改列名: 两种一种表中无数据:alter table 表名 modify 列名 修改后类型;表总有数据:alter table 表名 add 新列名 目标类型; update table 表名 set 新列名=列名;
5.修改表名:alter table 表名 dorp column 列名;alter table 表名 rename column 新列名 to 列名; 修改完毕。
6.添加数据: insert into 表名 (列名,...)values(列值,...(值与前面的顺序相对应)) ;或者 insert into 表名 values (列值,....(这里的列是全部的列值,不可以省略或者不填));
7.查看整条数据: select * from 表 where 条件 (获取所有的可以写成 where 1=1(表示条件永远成立));
8.查看个选定列的数据: select 列名,列名,... from 表名 where 条件 (获取所有的可以写成 where 1=1(表示条件永远成立));
9.删除列: alter table 表名 drop column 列名;
10.修改数据: update 表名 set 列名=值 where 条件;
11.删除数据: delete from 表名 where 条件;delete 表名 where 条件
12.删除表: drop table 表名;
13.复制表:create table 新表名 as (select * from 目标表 where 条件(复制整表为1=1 一直成立 复制 表结构为1=0 一直不成立不导入数据));
创建数据库: create database dbname;
1.创建表: create table (l列名 类型,...);
2.修改表名: alter table 表名 rename to 新表名;
3.添加列: alter table 表名 add 列名 类型;
4.修改列名: 两种一种表中无数据:alter table 表名 modify 列名 修改后类型;表总有数据:alter table 表名 add 新列名 目标类型; update table 表名 set 新列名=列名;
5.修改表名:alter table 表名 dorp column 列名;alter table 表名 rename column 新列名 to 列名; 修改完毕。
6.添加数据: insert into 表名 (列名,...)values(列值,...(值与前面的顺序相对应)) ;或者 insert into 表名 values (列值,....(这里的列是全部的列值,不可以省略或者不填));
7.查看整条数据: select * from 表 where 条件 (获取所有的可以写成 where 1=1(表示条件永远成立));
8.查看个选定列的数据: select 列名,列名,... from 表名 where 条件 (获取所有的可以写成 where 1=1(表示条件永远成立));
9.删除列: alter table 表名 drop column 列名;
10.修改数据: update 表名 set 列名=值 where 条件;
11.删除数据: delete from 表名 where 条件;delete 表名 where 条件
12.删除表: drop table 表名;
13.复制表:create table 新表名 as (select * from 目标表 where 条件(复制整表为1=1 一直成立 复制 表结构为1=0 一直不成立不导入数据));
相关文章推荐
- Oracle sql语句简单优化
- oralce 基础知识 ,oralce 常用简单sql语句,oracle 新手必看之一
- 『ORACLE』 SQL语句简单应用(二)(11g)
- oracle 一些简单的sql语句
- 简单oracle分页sql语句
- Oracle动态SQL语句的简单执行
- Oracle中简单查询、限定查询、数据排序SQL语句范例和详细注解
- oralce 基础知识 ,oralce 常用简单sql语句,oracle 新手必看之一
- oracle简单和复杂的SQL语句练习
- 【ORACLE】一个简单实用的对数据进行行列转换并统计的SQL语句
- Oracle中简单查询、限定查询、数据排序SQL语句范例和详细注解
- 有时候执行的oracle,sql语句要查看下性能情况,可以用这个进行下简单计算和统计
- 【ORACLE】一个简单实用的对数据进行行列转换并统计的SQL语句
- oracle 简单sql语句
- Oracle中备份表的简单sql命令语句
- Oracle sql语句简单优化
- oracle学习---简单的sql语句查询
- 『ORACLE』 SQL语句简单应用(五)(11g)
- Oracle sql语句简单优化
- Oracle 动态SQL语句(1)之简单书写