[oracle@aa ~]$ rlwrap sqlplus Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter user-name: scott set linesize 200 select ename,sal,comm from emp;
ENAME SAL COMM
---------- ---------- ----------
SMITH 800
ALLEN 1600 300
WARD 1250 500
JONES 2975
MARTIN 1250 1400
BLAKE 2850 select ename,sal,sal*comm from emp; select ename||sal as "employees's salary" from emp; select ename||' is a '||job as "Employes Details" from emp; select distinct deptno from emp; select ename,mgr from emp where mgr is null; select ename,sal,deptno from emp where deptno=10 order by sal desc; select deptno,trim(1 from deptno) from emp where deptno=10;
DEPTNO TRIM(1FROMDEPTNO)
---------- ----------------------------------------
10 0
10 0
10 0
SQL> select job,trim('C' from job) from emp where job='CLERK';
JOB TRIM('C'F
--------- ---------
CLERK LERK
CLERK LERK
CLERK LERK
CLERK LERK
***** 只能去除首尾的字母?
SQL> select round(46.937,2),round(46.937,1),round(46.937,0),round(46.937,-1) from dual; dual是一个伪表,用来测试函数和表达式
ROUND(46.937,2) ROUND(46.937,1) ROUND(46.937,0) ROUND(46.937,-1)
--------------- --------------- --------------- ----------------
46.94 46.9 47 50
==================================================================================================================================================================================
远程登录。
180------100
客户端 服务端
服务端必须有一个帐户,并且有连接的权限,开了监听
客户端配置了监听
sqlplus ly/ly@o100
==================================================================================================================================================================================