Oracle ÖеÄUnion¡¢Union All¡¢Intersect¡¢Minus
ÖÚËùÖÜÖªµÄ¼¸¸ö½á¹û¼¯¼¯ºÏ²Ù×÷ÃüÁ½ñÌìÏêϸµØ²âÊÔÁËһϣ¬·¢ÏÖһЩÎÊÌ⣬¼Ç¼±¸¿¼¡£ ¼ÙÉèÎÒÃÇÓÐÒ»¸ö±íStudent£¬°üÀ¨ÒÔÏÂ×Ö¶ÎÓëÊý¾Ý£º drop table student;
create table student
(
id int primary key,
name nvarchar2(50) not null,
score number not null
);
insert into student values(1,'Aaron',78);
insert into student values(2,'Bill',76);
insert into student values(3,'Cindy',89);
insert into student values(4,'Damon',90);
insert into student values(5,'Ella',73);
insert into student values(6,'Frado',61);
insert into student values(7,'Gill',99);
insert into student values(8,'Hellen',56);
insert into student values(9,'Ivan',93);
insert into student values(10,'Jay',90);
commit;
UnionºÍUnion AllµÄÇø±ð¡£
select *
from student
where id < 4
union
select *
from student
where id > 2 and id < 6
½á¹û½«ÊÇ
1 Aaron 78
2 Bill 76
3 Cindy 89
4 Damon 90
5 Ella 73
Èç¹û»»³ÉUnion AllÁ¬½ÓÁ½¸ö½á¹û¼¯£¬Ôò·µ»Ø½á¹ûÊÇ£º
1 Aaron 78
2 Bill 76
3 Cindy 89
3 Cindy 89
4 Damon 90
5 Ella 73
¿ÉÒÔ¿´µ½£¬UnionºÍUnion AllµÄÇø±ðÖ®Ò»ÔÚÓÚ¶ÔÖØ¸´½á¹ûµÄ´¦Àí¡£
½ÓÏÂÀ´ÎÒÃǽ«Á½¸ö×Ó²éѯµÄ˳Ðòµ÷Õûһϣ¬¸ÄΪ
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00
Ïà¹ØÎĵµ£º
SQL> select * from ta;
ID NAME
---------- --------------------
1 gorey
2 gorey2
SQL> select * from tb;
I ......
ת×Ô£ºhttp://download.oracle.com/docs/cd/B13789_01/server.101/b10759/statements_6004.htm
Creating User-Defined Operators: Example
This example creates a very simple functional implementation of equality and then creates an operator that uses the function:
CREATE FUNCTION eq_f(a VARCHAR2, b VARCHA ......
Ë÷Òý¾Û´Ø±í
create cluster emp_dept_cluster
(deptno number(2)) size 1024;
size 1024 ±íʾÿ¸ö¾Û´Ø¼üÖµ¹ØÁª´óÔ¼1024×Ö½ÚµÄÊý¾Ý,
oracle»áÔÚÓÃÕâ¸öÊý¾Ý¿â¿éÉÏͨ¹ýsize¼ÆËã×î¶à¿ÉÒԷŶàÉÙ¸ö´Ø
Èç¹û¿éÊÇ8KB,ÄÇôÕâ¸ö¿éÉÏ×î¶à·Å7¸ö¾Û´Ø¼ü
Ïò¾Û´ØÖзÅÊý¾Ý֮ǰ,ÐèÒªÏȶԾ۴ؽ¨Á¢Ë÷Òý.
create index emp_dept_cluster_id ......
1¡¢²é¿´Êý¾Ý¿â×Ö·û¼¯
Êý¾Ý¿â·þÎñÆ÷×Ö·û¼¯select * from nls_database_parameters£¬ÆäÀ´Ô´ÓÚprops$£¬ÊDZíʾÊý¾Ý¿âµÄ×Ö·û¼¯¡£
¡¡¡¡
¡¡¡¡¿Í»§¶Ë×Ö·û¼¯»·¾³select * from nls_instance_parameters,ÆäÀ´Ô´ÓÚv$parameter£¬
¡¡¡¡
¡¡¡¡±íʾ¿Í»§¶ËµÄ×Ö·û¼¯µÄÉèÖ㬿ÉÄÜÊDzÎÊýÎļþ£¬»·¾³±äÁ¿»òÕßÊÇ×¢²á±í
¡¡¡¡
¡¡¡¡»á»°×Ö·û¼¯» ......
crsctl stop crs
killall init.crsd
cd /etc/init.d
rm -rf init.crs init.crsd init.cssd init.evmd
rm -rf /tmp/.oracle/
rm -rf /var/tmp/
rm -rf /var/tmp/.oracle/
cd /etc
rm -rf oraInst.loc oracle/ oratab
rm -rf $ORACLE_BASE
dd if=/dev/zero of=/dev/raw/raw_voting_disks bs=1024k
dd if=/dev/zero ......