我们背着压力不停地追赶不断地努力,到最后才发觉,我们真正想要的就是幸福........................................ Travelling in real lify with my dream and enthusiasm

oracle train(一)

上一篇 / 下一篇  2007-09-27 21:17:55

51Testing软件测试网Y/W6Tp i*k ~H

连接    connect conn
LM-? mT7X{J0connect username/password as sysdba
a ik M'y,K0y/f0普通用户51Testing软件测试网7W8H9pRvW+h/?
scott tiger51Testing软件测试网QDr&_7MSbC
hr   hr51Testing软件测试网*L+iFQ zI7?.U
管理员
'liKN$L e9]0sys change_on_install
4^!G^v,U0system manager查共有多少表: tabs        user_table显示用户:
"C(gd;Q b3^4L @0show user;51Testing软件测试网f6G(t hJr;w9w7QUo$I
管理员解锁用户51Testing软件测试网 n$~^P(T6p.u
alert user username (hr) account unlock51Testing软件测试网@|FbY~9?G D[ P
alert user username (hr) identified by hr给一个列取别名:
4x"iNY`#a;~0column_name as "alias name" (两个别名的单词一定要加“”)51Testing软件测试网~HI,g%juM1p+T

51Testing软件测试网`:TMOS2cZ

http://localhost:7778/isqlplus51Testing软件测试网2rZh9X/{1f JWW
连接两个字段:
j,b{\:hV#Z o0select last_name||job_id as "Employees" from employees;51Testing软件测试网J$T9mB,Xl \*Tv
插入字符串:51Testing软件测试网!s9d,_|1w*~G
select last_name||'is a '||job_id as "Employees details" from employees;
!Np6h/kW_n0匹配语句:select first_name from employees where first_name like '__a%';

3S t'p0wDK[fN0

tUP!_*D@*G0转移字符:first_name like '%\%ab' escaple '\'  (查找以%ab结尾的词)

? F'^e2I'h%Fh0 51Testing软件测试网4_-^(T[nb9XGU.Hf

select first_name manager_id from employees where manager_id is  Null;51Testing软件测试网 _E8IT2dIlD.f

51Testing软件测试网$`U,UD M)]:U

排序(默认为升序)select last_name,job_id,department_id,hire_date from employees order by hire_date desc;51Testing软件测试网#r4fbj b9s

/^9fS%`VA;w0select department_id,last_name,salary   from employees order by department_id,salary desc;51Testing软件测试网A,kGo9zuk#dS

a;f:S:cY,i/w0函数:把大写字母变成小写:lower()  51Testing软件测试网W#YEbu3zwr W

51Testing软件测试网;a6Vm?ZCL ?

把小写字母变成大写: upper()51Testing软件测试网VMF*X/t m+Q

51Testing软件测试网wgf!B-x ~@6S]

把第一个字母变大写其余的小写: initcap(asdWJ) :Asdwj

/wpY`e"K)g2I0 51Testing软件测试网 B4Z,hL,r$\k8Sx {u

concat(hello, world) :helloworld

g EFzH%xm#Xi;nB8P0

1fhP2rZ0substr(helloworld  3,6):llow

!gUV t W@0

!A7Hc:Q9\#o u0O0length(last_name)

N,P\(^B-o0

ke'_a2Ikz0instr('helloworld' 'w') :651Testing软件测试网3H d)cU&Q/x9w

51Testing软件测试网5`%T9zy| u.\3b,M

lpad(salary,10,'*'):*******100

(aT^Y,V2V0 51Testing软件测试网 J VE$o_q c

rpad(salary,10,'*') :100*******51Testing软件测试网9V)d0ijda`+]Q

51Testing软件测试网.Y9z7c-y0W:}

select round(45.936,-1) from dual; 50
_6Xv&q.H:jy_d0select round(45.936,-2) from dual; 0
,T~ U/o G2qc0select round(45.936,0) from dual;   46
&z/aOX L^ s"[K_ e'X0select round(45.936,1) from dual;    45.951Testing软件测试网/KL2_g*^w.Y
select round(45.936,2) from dual;     45.94
d,q4|"@:E%[0
Kz lwA)Y~3H051Testing软件测试网'O/eY o4z} C


TAG:

 

评分:0

我来说两句

日历

« 2024-04-22  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 13871
  • 日志数: 30
  • 图片数: 1
  • 建立时间: 2007-03-17
  • 更新时间: 2008-01-04

RSS订阅

Open Toolbar