a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 181|回复: 0

[综合] Oracle常遇问题解析26

[复制链接]
发表于 2012-8-4 13:54:49 | 显示全部楼层 |阅读模式
116. 两个结果集互加的函数?  * M$ v9 X; [. w" t
sql>select * from bsempms_old intersect select * from bsempms_new;  
! o7 E! R1 O1 w7 @: c! |0 A. zsql>select * from bsempms_old union select * from bsempms_new;  5 r' {7 J3 }" c2 q7 k0 J4 M4 ^
sql>select * from bsempms_old union all select * from bsempms_new;  5 Z0 e7 I: o6 t- ]( r' J4 u
  ) u6 F3 r0 J/ R' f$ ~! z; H
117. 两个结果集互减的函数?  , N' f8 @/ u( C( x$ E2 k
sql>select * from bsempms_old minus select * from bsempms_new;  ! r0 G) l5 z; _" a
  
, a- A7 D  [5 ^4 J118. 如何配置sequence?  # [( E3 K6 S/ X7 H1 G& Q
建sequence seq_custid  + ]) w( E" Q2 y
create sequence seq_custid start 1 incrememt by 1;  
" j, _6 H0 r/ _# P建表时:  
7 k0 n! L2 b0 r5 L: {create table cust  
/ @, T! o! A! ~3 I{ cust_id smallint not null,  
/ B; G/ I% s5 Z, E9 m$ F$ H% c1 w1 l/ n...}  . D- I" y" J* A. M! ^) N0 L
insert 时:  
) T- c1 g. C% m( W2 ^4 ~$ Qinsert into table cust  
* W4 i9 U+ }+ j3 t0 |1 e( b4 vvalues( seq_cust.nextval, ...)  ( g5 r6 Y1 C3 C' \5 y4 d
  
1 |, O- M2 Z' ~( v日期的各部分的常用的的写法  
/ H) w: A% T" U119>.取时间点的年份的写法:  - c1 }5 O/ N* f, }, z
select to_char(sys2003-10-17,’yyyy’) from dual;  ( O+ h3 c% i2 g2 u# H8 x
  ' v7 Y: h- N* Q; d6 w
120>.取时间点的月份的写法:  
) c) ?. N# j5 zselect to_char(sys2003-10-17,’mm’) from dual;
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-6-15 15:15 , Processed in 0.170294 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表