OracleµÄ¼¯ºÏÔËËã·û
±í1£ºtemp1
AA BB CC
1 1 1
1 1 2
1 1 3
±í2£ºtemp2
AA BB CC
1 1 1
1 1 4
1£¬minus
select aa,bb,cc from temp1
minus
select aa,bb,cc from temp2
½á¹û£º
AA BB CC
1 1 2
1 1 3
select aa,bb,cc from temp2
minus
select aa,bb,cc from temp1
½á¹û£º
AA BB CC
1 1 4
2,intersect
select aa,bb,cc from temp1
intersect
select aa,bb,cc from temp2
½á¹û£º
AA BB CC
1 1 1
select aa,bb,cc from temp2
intersect
select aa,bb,cc from temp1
½á¹û£º
AA BB CC
1 1 1
3£¬union union all Ê¡ÂÔ
Ïà¹ØÎĵµ£º
µÚÒ»²¿·Ö¡¢SQL&PL/SQL
[Q]ÔõôÑù²éѯÌØÊâ×Ö·û£¬ÈçͨÅä·û%Óë_
[A]select * from table where name like 'A_%' escape ''
[Q]ÈçºÎ²åÈëµ¥ÒýºÅµ½Êý¾Ý¿â±íÖÐ
[A]¿ÉÒÔÓÃASCIIÂë´¦Àí£¬ÆäËüÌØÊâ×Ö·ûÈç&Ò²Ò»Ñù£¬Èç
insert into t values('i'||chr(39)||'m'); -- chr(39)´ú±í×Ö·û'
»òÕßÓÃÁ½¸öµ¥ÒýºÅ±íʾһ¸ö
or ......
1.±¸·Ýscott
£¨1£©ÔÚCÅ̵ĸùĿ¼Ï´´½¨Ò»¸öÎļþ¼Ðtemp
£¨2£©ÔÚcmdÔÚ½øÈëÎļþ¼Ð£¬del *.* £¬É¾³ýËùÓÐÎļþ¡£
£¨3£©ÊäÈëexp
£¨4£©ÊäÈëÓû§ÃûºÍÃÜÂë:scott/tiger
£¨5£©¾Í»áÏÔʾ“ÊäÈëÊý×éÌáÈ¡»º³åÇø´óС”£¬ÔÚÕâÒ»²½Ö±½Ó»Ø³µ¾ÍÐÐÁË
£¨6£©ÏÔʾ“µ¼³öÎļþ£ºDXPDAT.DMP>”£¬ÕâÒ»²½Ò²Êǻسµ
£¨ ......
Ò»,INSERT
1.ΪÁ˲»´òÂÒÔÀ´µÄ±íµÄÊý¾Ý,ËùÒÔ±¸·ÝÔÀ´µÄÊý¾Ý.
create table emp2 as select * from emp
create table emp3 as select * from emp
create table dept2 as select * from dept
create table salgrade2 as select * from salgrade
2.²é¿´±íµÄÉè¼ÆÇé¿ö:desc dept2;±íʾ²é¿´±ídept2µÄÉè¼ÆÇé¿ö.
3.²åÈëÊý¾Ýµ ......
¿ÉÒÔʹÓÃGROUPING_IDº¯Êý½èÖúHAVING×Ó¾ä¶Ô¼Ç¼½øÐйýÂË£¬½«²»°üº¬Ð¡¼Æ»òÕß×ܼƵļǼ³ýÈ¥¡£GROUPING_ID()º¯Êý¿ÉÒÔ½ÓÊÜÒ»Áлò¶àÁУ¬·µ»ØGROUPINGλÏòÁ¿µÄÊ®½øÖÆÖµ¡£GROUPINGλÏòÁ¿µÄ¼ÆËã·½·¨Êǽ«°´ÕÕ˳Ðò¶ÔÿһÁе÷ÓÃGROUPINGº¯ÊýµÄ½á¹û×éºÏÆðÀ´¡£
¹ØÓÚGROUPINGº¯ÊýµÄʹÓ÷½·¨¿ÉÒԲμûÎÒÇ°ÃæдµÄһƪÎÄÕÂ
http://blog.csdn ......