基本命令

来源:互联网 发布:joo yeon seo韩国女星 编辑:程序博客网 时间:2024/06/06 00:37

用户登录

普通用户登录
C:\>sqlplus scott/11  quit退出 用户名+密码
超级用户登录

C:\>sqlplus /nolog

SQL*Plus: Release 10.1.0.2.0 - Pr

Copyright (c) 1982, 2004, Oracle.

SQL> connect /as sysdba   //操作用户登录方式
已连接。


界面设置

set linesize 150 设置行宽 

set pagesize 140 设置页大小

设置列宽
数字             SQL> col empno for 99999999999999999999

字符方式设置列宽
 SQL> col ename for a20
 SQL> select * from emp;

清屏
host cls


空值问题:
1 NULL空值 任何数和null运算都为null    (null无穷大)

2 空值不是空  null != null

null滤空函数 nvl (a, b) -- 当a是空的时候,返回b( 其中 b可以是数字/字符串)
---字符串和日期在sql语言用单引号扩起来...


连接符 
select 'hello' || 'world' from emp;

select 'hello' || 'world' from dual;  --伪表


dual是数据字典 (oracle超级管理员分配给普通用的资源....,tab关键字....)

SQL> select sysdate from dual;

SYSDATE
--------------
07-10月-14


原创粉丝点击