sqlplus使用(二)
5 Using Scripts in SQL*Plus
1.定义环境变量
DEFINE _EDITOR = vi
EDIT SALES
1 select
2 *
3 from
4* v$instance
| Command | Abbreviation | Purpose |
|---|---|---|
APPEND text |
A text |
adds text at the end of the current line |
CHANGE/old/new |
C/old/new |
changes old to new in the current line |
CHANGE/text |
C/text |
deletes text from the current line |
CLEAR BUFFER |
CL BUFF |
deletes all lines |
DEL |
(none) |
deletes the current line |
DEL n |
(none) |
deletes line n |
DEL * |
(none) |
deletes the current line |
DEL n * |
(none) |
deletes line n through the current line |
DEL LAST |
(none) |
deletes the last line |
DEL m n |
(none) |
deletes a range of lines (m to n) |
DEL * n |
(none) |
deletes the current line through line n |
INPUT |
I |
adds one or more lines |
INPUT text |
I text |
adds a line consisting of text |
LIST |
; or L |
lists all lines in the SQL buffer |
LIST n |
L n or n |
lists line n |
LIST * |
L * |
lists the current line |
LIST n * |
L n * |
lists line n through the current line |
LIST LAST |
L LAST |
lists the last line |
LIST m n |
L m n |
lists a range of lines (m to n) |
LIST * n |
L * n |
lists the current line through line n |
SELECT &GROUP_COL, MAX(&NUMBER_COL) MAXIMUM
FROM &TABLE
GROUP BY &GROUP_COL
.
SAVE STATS
GET STATS
SELECT &GROUP_COL, |
2
2* MAX(&NUMBER_COL) MAXIMUM |
APPEND ,
2* MAX(&NUMBER_COL) MAXIMUM, |
CHANGE/&/&&
2* MAX(&&NUMBER_COL) MAXIMUM, |
I
3i |
MIN (&&NUMBER_COL) MINIMUM,
4i |
SUM(&&NUMBER_COL) TOTAL,
5i |
AVG(&&NUMBER_COL) AVERAGE
6i |
1
1* SELECT &GROUP_COL, |
CHANGE/&/&&
1* SELECT &&GROUP_COL, |
7
7* GROUP BY &GROUP_COL |
CHANGE/&/&&/
7* GROUP BY &&GROUP_COL |
SAVE STATS2
Created file STATS2 |
PROMPT
PROMPT Enter a title of up to 30 characters
ACCEPT MYTITLE PROMPT 'Title: '
TTITLE LEFT MYTITLE SKIP 2
SELECT EMPLOYEE_ID, FIRST_NAME, LAST_NAME, SALARY
FROM EMP_DETAILS_VIEW
WHERE JOB_ID='SA_MAN'
CLEAR BUFFER
CLEAR SCREEN
CLEAR COLUMNS
sqlplus使用(二)的更多相关文章
- mongodb选型问题
一.Mongodb的介绍 MongoDB 是一个跨平台的,面向文档的数据库,提供高性能,高可用性和可扩展性方便. MongoDB工作在收集和文件的概念. 数据库 数据库是一个物理容器集合.每个数据库都 ...
- 【OCP、OCM、高可用等】小麦苗课堂网络班招生简章(从入门到专家)--课程大纲
[OCP.OCM.高可用等]小麦苗课堂网络班招生简章(从入门到专家)--课程大纲 小麦苗信息 我的个人信息 网名:小麦苗 QQ:646634621 QQ群:618766405 我的博客:http:// ...
- 【OCP|OCM】Oracle培训考证系列
[OCP|OCM]Oracle培训考证系列 我的个人信息 网名:小麦苗 QQ:646634621 QQ群:618766405 我的博客:http://blog.itpub.net/26736162 ...
- 一,连接Oracle 一
连接Oracle数据库方法: 一,使用sqlplus连接 二,使用第三方软件连接 sqlplus sqlplus 工具简介 (1).概述:sqlplus是在Linux下操作oracle的工具 (2). ...
- oracle入坑日记<二>认识oracle(含sqlplus基础使用)
1.SID(数据库实例) 1.1. oracle安装的时候有一项叫[全局数据库名]的填写项,这个就是oracle的SID也是数据库的唯一标识符: 1.2.一个oracle数据库有且只有一个SID(一般 ...
- Oracle记录(二) SQLPlus命令
对于Oracle数据库操作主要使用的是命令行方式,而所有的命令都使用sqlplus完成,对于sqlplus有两种形式.就我个人而言,还是比较喜欢UNIX与Linux下的Oracle.呵呵 一种是dos ...
- 学习笔记:oracle学习二:oracle11g数据库sql*plus命令之常用sqlplus命令、格式化查询结果
目录 1.常用sqlplus命令 1.1 HELP命令 1.2 describe命令 1.3 SPOOL命令 1.4 其他常用命令 1.4.1 define命令 1.4.2 show命令 1.4.3 ...
- Oracle笔记(二) SQLPlus命令
对于Oracle数据库操作主要使用的是命令行方式,而所有的命令都使用sqlplus完成,对于sqlplus有两种形式. 一种是dos风格的sqlplus:sqlplus.exe; 另一种是window ...
- 【翻译】MongoDB指南/CRUD操作(二)
[原文地址]https://docs.mongodb.com/manual/ MongoDB CRUD操作(二) 主要内容: 更新文档,删除文档,批量写操作,SQL与MongoDB映射图,读隔离(读关 ...
随机推荐
- WebClient 访问https
解决SSH证书问题: webClient.getOptions().setUseInsecureSSL(true);//解决ssh证书访问https的问题
- putty快速设置本地代理
sudo plink -D 127.0.0.1:8888 -l root -P 443 -pw xxx 104.xxx.xxx.xxx
- phpcms调用某个栏目下的所有二级栏目
在html中直接这样调用就可以了,subcat中的值为父栏目的catid {loop subcat(93) $r}{/loop} 注意subcat方法的参数,如果只写一个参数,也就是父栏目id,那该父 ...
- linux系统vsftpd登陆慢卡怎么办
linux系统vsftpd登陆慢卡怎么办 浏览:145 | 更新:2013-12-31 00:50 vsftpd是linux系统中的一款ftp软件,用它可以实现文件,数据上传与下载,但有些用户会发现v ...
- Spring框架学习[IoC容器高级特性]
1.通过前面4篇文章对Spring IoC容器的源码分析,我们已经基本上了解了Spring IoC容器对Bean定义资源的定位.读入和解析过程,同时也清楚了当用户通过getBean方法向IoC容器获取 ...
- listener.ora/sqlnet.ora/tnsnames.ora配置文件详解
oracle网络配置 三个配置文件 listener.ora.sqlnet.ora.tnsnames.ora ,都是放在$ORACLE_HOME/network/admin目录下. 英文说明: The ...
- Reorder array to construct the minimum number
Construct minimum number by reordering a given non-negative integer array. Arrange them such that th ...
- 【leetcode】Search a 2D Matrix
Search a 2D Matrix Write an efficient algorithm that searches for a value in an m x n matrix. This m ...
- poj 1847( floyd && spfa )
http://poj.org/problem?id=1847 一个水题,用来熟悉熟悉spfa和floyd的. 题意:有m条的铁路,要从x,到y, 之后分别就是条铁路与其他铁路的交点.第一个输入的为有n ...
- POJ 1016
http://poj.org/problem?id=1016 一道字符串处理的题目,理解题意后注意细节就好. 题意:每一串数字 都可以写成 a1 b1 a2 b2 ....ai bi 其中ai是指bi ...