¸ßÊÖ,ÇóÒ»oracle sql²éѯ¹¦ÄÜ - Oracle / ¿ª·¢
-----²âÊÔ±í(oracle 10G):
create table portal_his.testuser(
XH numeric NOT NULL ,-----¸Ã×Ö¶ÎÖµÊÇΨһµÄ;
deptid numeric NOT NULL ,
zwid numeric NULL ,
names varchar(20) NULL,
constraint testuser_pk PRIMARY KEY (XH)
);
------²âÊÔÊý¾Ý:
insert into portal_his.testuser(XH,deptid,zwid,names)
values(1,1,2,'a1');
insert into portal_his.testuser(XH,deptid,zwid,names)
values(2,1,2,'a1');
insert into portal_his.testuser(XH,deptid,zwid,names)
values(3,1,3,'a3');
insert into portal_his.testuser(XH,deptid,zwid,names)
values(4,1,2,'');
insert into portal_his.testuser(XH,deptid,zwid,names)
values(5,2,4,'a4');
insert into portal_his.testuser(XH,deptid,zwid,names)
values(6,2,6,'a4');
insert into portal_his.testuser(XH,deptid,zwid,names)
values(7,2,10,'a5');
insert into portal_his.testuser(XH,deptid,zwid,names)
values(8,3,10,'');
insert into portal_his.testuser(XH,deptid,zwid,names)
values(9,2,10,'');
insert into portal_his.testuser(XH,deptid,zwid,names)
values(10,3,10,'a7');
Çósql²éѯ¹¦ÄÜ:
-----Èç¹ûnames×Ö¶ÎֵΪ''»ònull,Ôò°Ñ¸Ã¼Ç¼ÖÐdeptidºÍzwidÖµÏàµÈµÄnames×Ö¶ÎÖµÄÚÈÝȡһ¸ö³öÀ´(Èç¹ûÕÒµ½¾Íȡһ¸ö³öÀ´,ûÓÐÕÒµ½¾Í²»¹ÜËü).
xh deptid zwid names
1 1 2 a1
2 1 2 a1
3 1 3 a3
4 1 2 -----ÕâÀïµÄ²éѯ
Ïà¹ØÎÊ´ð£º
ÔÚÖ´ÐаüµÄʱºòÒýÓÃoracle spatial¿Õ¼äº¯Êý³ö´í£¬³ö´íÇé¿öÈçÏÂ
Errors in file
/user/oracle/app/oracle/admin/grid/udump/grid1_ora_143768.trc: ORA-29902:
error in executing ODCIIndexStart() routine ORA-0 ......
ÓÃPL/SQL µÇ½ʱµ¯³ö±¨´í´°¿Ú£¬´íÎóÈçÏ£¡
ORA-01034:ORACLE not available
ORA-27101:shared memory realm does not exist
ÇëÎÊ£¬ÓÐûÓÐÈËÓöµ½ÕâÖÖÇé¿ö£¬Ôõô½â¾ö£¿Ð»Ð»£¡
1. Oracle sid ÕýÈ ......
¼ÙÉètable01 ÖÐÓÐ ÒÔÏÂ×ÊÁÏ
emp_no emp_name
------- ------------
0001 TOM
0002 JOHN
0003 MARY
³£Óõ绰
¶øÎÒÃÇÒªµÃµ½ÒÔϵÄOUTPUT (»òÊǸ÷ÖÖÆäËûµÄoutput)
0001,TOM
0002,JOHN
......
×Ö¶Î1,×Ö¶Î2.....×Ö¶ÎN,Status,ParentID
1,Name1....test1,1,99
1,Name1....test1,3,99
1,Name2....test2,1,101
1,Name2....test2,3,101
1,Name3....test3,2,101
1,Name1....test1,4,101
ÏëÒªµÄ½á¹ûÊÇ:
1,Na ......
ÎҵĴ¦ÀíÊÇÕâÑùµÄ£º
ÎÒÓÐÒ»¸öºÜ´óµÄÊý¾Ý¼¯ºÏ£¬´¦ÓÚÐÔÄÜ·½ÃæµÄ¿¼ÂÇÐèҪʹÓÃÁÙʱ±í¹ý¶É£¬²¢ÇÒʹÓ÷ÖÒ³µÄ·½Ê½ÏòÁÙʱ±íÖвåÈëÊý¾Ý£¬Êý¾ÝʹÓÃÍê±Ïºó£¬É¾³ýÁÙʱ±íµÄÊý¾Ý¡£
³öÏÖµÄÏÖÏ󣺵±OracleÖØÐÂÆô¶¯ºó£¬µÚÒ»Ò³²åÈëµÄ ......