sqlplus登录方式,列出所有表,列出表结构,sqlplus行和列显示设置,别名,空值问题,连接符,DISTINCT(二)

2014-11-24 14:47:40 · 作者: · 浏览: 1
MAN 7698 08-9月 -81 1500 0 30

10 连接符 ||

select 'hello' || 'world' from emp;

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

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

SQL> select sysdate from dual;

SYSDATE

--------------

07-10月-14

SQL>

11:DISTINCT

A 作用去除重复的行

select DISTINCT deptno from emp;

DEPTNO

----------

30

20

10

B DISTINCT修饰多个字段的时, 当部门编号和工种都一样的时候,认为是重复的...

否则不同行.

====DISTINCT2个字段

selectDISTINCT deptno, job from emp