ORacle语句
MYSQL/MSSQL/ORACLE数据库脚本代码 收藏
/******************************************************************************/
/*
主流数据库MYSQL/MSSQL/ORACLE测试数据库脚本代码
脚本任务:建立4个表,添加主键,外键,插入数据,建立视图
运行环境1:microsoft sqlserver 2000 查询分析器
运行环境2:mysql5.0 phpMyAdmin网页界面
运行环境3:oracle 9i SQL*PLUS命令行界面
author:chinayaosir
blog: http://blog.csdn.net/chinayaosir/
QQ: 44633197
声明:严禁其它网站不经过作者chinayaosir同意任意转载
*/
/******************************************************************************/
/*script test ok with microsoft sqlserver 2000 查询分析器 */
/******************************************************************************/
/*DB:MSSQL2000 SCRIPT*/
/*0.drop table list*/
drop table Employee;
drop table Department;
drop table Post;
drop table Account;
/*********************************************************/
/*DB:MSSQL2000 SCRIPT*/
/*1.create all table*/
create table Account(
oid int not null,
username varchar(30) not null,
password varchar(10) null,
invalid varchar(1) null
);
create table bab.Post(
/*oid int identity(1,1) not null primary key,*/
oid int not null,
postName varchar(30) not null
);
create table Department(
oid int not null,
deptName varchar(30) not null,
parentid int null,
manager varchar(30) null,
email varchar(30) null
);
create
相关文档:
用Oracle9i自带的企业管理器或PL/SQL图形化的方法创建表空间和用户以及分配权限是相对比较简单的,本文要介绍的是另一种方法,使用Oracle 9i所带的命令行工具:SQLPLUS来创建表空间,这个方法用起来更加简明快捷。
假设 ......
当我们获取数据时,可能会有这样的需求,即每次从表中获取数据时,是随机获取一定的记录,而不是每次都获取一样的数据,这时我们可以采取Oracle内部一些函数,来达到这样的目的.
1) select * from (select * from tablename order  ......
一. 死锁的检测
--查死锁的会话。
select A.sid, b.serial#,
decode(A.type,
'MR', 'Media Recovery',
'RT','Redo Thread',
'UN','User Name',
'TX', 'Transaction',
'TM', ' ......
首先,你要有一张表!
CREATE TABLE example(
ID Number(4) NOT NULL PRIMARY KEY,
NAME VARCHAR(25 ......
1.使用sqlldr
2.首先建立相应的表
create table test(ip1 number, ip2 number, locate varchar2(512),country varchar2(60),province varchar2(60),city varchar2(60))
3.写控制文件 city.ctl
load data
infile 'c:\city.txt'
append into table test
--when country='中国'
fields terminated by ','
(
ip1,
ip ......