ORACLE NULLÏê½â
ÎÊ£ºÊ²Ã´ÊÇNULL£¿
´ð£ºÔÚÎÒÃDz»ÖªµÀ¾ßÌåÓÐʲôÊý¾ÝµÄʱºò£¬Ò²¼´Î´Öª£¬¿ÉÒÔÓÃNULL£¬ÎÒÃdzÆËüΪ¿Õ£¬ORACLEÖУ¬º¬ÓпÕÖµµÄ±íÁ㤶ÈΪÁã¡£
ORACLEÔÊÐíÈκÎÒ»ÖÖÊý¾ÝÀàÐ͵Ä×Ö¶ÎΪ¿Õ£¬³ýÁËÒÔÏÂÁ½ÖÖÇé¿ö£º
1¡¢Ö÷¼ü×ֶΣ¨primary key£©£¬
2¡¢¶¨ÒåʱÒѾ¼ÓÁËNOT NULLÏÞÖÆÌõ¼þµÄ×Ö¶Î
˵Ã÷£º
1¡¢µÈ¼ÛÓÚûÓÐÈκÎÖµ¡¢ÊÇδ֪Êý¡£
2¡¢NULLÓë0¡¢¿Õ×Ö·û´®¡¢¿Õ¸ñ¶¼²»Í¬¡£
3¡¢¶Ô¿ÕÖµ×ö¼Ó¡¢¼õ¡¢³Ë¡¢³ýµÈÔËËã²Ù×÷£¬½á¹ûÈÔΪ¿Õ¡£
4¡¢NULLµÄ´¦ÀíʹÓÃNVLº¯Êý¡£
5¡¢±È½ÏʱʹÓùؼü×ÖÓÓis null”ºÍ“is not null”¡£
6¡¢¿ÕÖµ²»Äܱ»Ë÷Òý£¬ËùÒÔ²éѯʱÓÐЩ·ûºÏÌõ¼þµÄÊý¾Ý¿ÉÄܲ鲻³öÀ´£¬count(*)ÖУ¬ÓÃnvl(ÁÐÃû,0)´¦ÀíºóÔٲ顣
7¡¢ÅÅÐòʱ±ÈÆäËûÊý¾Ý¶¼´ó£¨Ë÷ÒýĬÈÏÊǽµÐòÅÅÁУ¬Ð¡→´ó£©£¬ËùÒÔNULLÖµ×ÜÊÇÅÅÔÚ×îºó¡£
ʹÓ÷½·¨£º
SQL> select 1 from dual where null=null;
ûÓв鵽¼Ç¼
SQL> select 1 from dual where null='';
ûÓв鵽¼Ç¼
SQL> select 1 from dual where ''='';
ûÓв鵽¼Ç¼
SQL> select 1 from dual where null is null;
1
---------
1
SQL> select 1 from dual where nvl(null,0)=nvl(null,0);
1
---------
1
¶Ô¿ÕÖµ×ö¼Ó¡¢¼õ¡¢³Ë¡¢³ýµÈÔËËã²Ù×÷£¬½á¹ûÈÔΪ¿Õ¡£
SQL> select 1+null from dual;
SQL> select 1-null from dual;
SQL> select 1*null from dual;
SQL> select 1/null from dual;
ÒÔÉÏËÄÌõÓï¾ä¾ù²éѯµ½Ò»¸ö¼Ç¼.
×¢£ºÕâ¸ö¼Ç¼¾ÍÊÇSQLÓï¾äÖеÄÄǸönull
ÉèÖÃijЩÁÐΪ¿ÕÖµ
update table1 set ÁÐ1=NULL where ÁÐ1 is not null;
ÏÖÓÐÒ»¸öÉÌÆ·ÏúÊÛ±ísale£¬±í½á¹¹Îª£º
month¡¡ char(6)¡¡ --Ô·Ý
sellnumber(10,2)¡¡--ÔÂÏúÊÛ½ð¶î
create table sale (month char(6),sell number);
insert into sale values('200001',1000);
insert into sale values('200002',1100);
insert into sale values('200003',1200);
insert into sale values('200004',1300);
insert into sale values('200005',1400);
insert into sale values('200006',1500);
insert into sale values('200007',1600);
insert into sale values('200101',1100);
insert into sale v
Ïà¹ØÎĵµ£º
ʹÓÃCursor:
--²âÊÔһϣ¬½ñÌì²ÅÉêÇëʹÓÃitpub.net µÄblog
declare
RoomID Room.RoomID%Type;
RoomName Room.RoomName%Type;
cursor crRoom is
select RoomID,RoomName
from Room;
begin
open crRoom;loop;
fetch crRoom into RoomID,RoomName;
exit when crRoom%notFound;
end loop;
close crRoom;
end;
& ......
1¡¢²éѯµÚ¼¸ÐеļǼ
select sal from emp where rownum=1; //²éѯµÃµ½µÚÒ»ÐмǼ
select sal from emp where rownum=5; //²»¿ÉÒÔ²éѯµ½µÚÎåÐмǼ£¬ÒòΪrownum ×ÜÊÇ´Ó1¿ªÊ¼²éѯµÄ£¬¹ÊÕâÖÖ·½Ê½²»¿ÉÒÔÖ±½ÓµÃµ½µÚ¼¸ÐеļǼ¡£ÈôÏëµÃµ½µÚÎåÐмǼ£¬Ó¦²ÉÓÃÈçÏ·½Ê½£º
select r,sal from (select rownum r,sal from emp) wher ......
1£®Ê²Ã´½Ð×öÂãÉ豸£¿
¡¡¡¡ÂãÉ豸£¬Ò²½ÐÂã·ÖÇø£¨Ôʼ·ÖÇø£©£¬ÊÇÒ»ÖÖûÓо¹ý¸ñʽ»¯£¬²»±»Unixͨ¹ýÎļþϵͳÀ´¶ÁÈ¡µÄÌØÊâ×Ö·ûÉ豸¡£ËüÓÉÓ¦ÓóÌÐò¸ºÔð¶ÔËü½øÐжÁд²Ù×÷¡£²»¾¹ýÎļþϵͳµÄ»º³å¡£
¡¡¡¡
¡¡¡¡2£®ÈçºÎ±æ±ðÂãÉ豸£¿
¡¡¡¡ÔÚUnixµÄ/dev Ŀ¼Ï£¬ÓÐÐí¶àÎļþ£¬ÆäÖÐÓÐÁ½¸ö´óÀࣺ×Ö·ûÉ豸ÎļþºÍ¿éÉ豸Îļþ¡£
¡¡¡¡× ......
±¾ÎÄÖ»ÌÖÂÛOracleÖÐ×î³£¼ûµÄË÷Òý£¬¼´ÊÇB-treeË÷Òý¡£±¾ÎÄÖÐÉæ¼°µÄÊý¾Ý¿â°æ±¾ÊÇOracle8i¡£
¡¡¡¡Ò». ²é¿´ÏµÍ³±íÖеÄÓû§Ë÷Òý
¡¡¡¡ÔÚOracleÖУ¬SYSTEM±íÊǰ²×°Êý¾Ý¿âʱ×Ô¶¯½¨Á¢µÄ£¬Ëü°üº¬Êý¾Ý¿âµÄÈ«²¿Êý¾Ý×ֵ䣬´æ´¢¹ý³Ì¡¢°ü¡¢º¯ÊýºÍ´¥·¢Æ÷µÄ¶¨ÒåÒÔ¼°ÏµÍ³»Ø¹ö¶Î¡£
¡¡¡¡Ò»°ãÀ´Ëµ£¬Ó¦¸Ã¾¡Á¿±ÜÃâÔÚSYSTEM±íÖд洢·ÇSYSTEMÓû§µÄ ......
¹Ø¼ü×Ö: oracle
Oracle°²×°ÖеÄDHCPÎÊÌâ
1.Linux
ÐÞ¸ÄhostsÎļþ ½«ipµØÖ·ÓëlocalhostÉ趨¾Í¿ÉÒÔÁË£¬ÈçÏÂ
vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
192.168.193.129 www.myzhtc.com
192.168.193.129 localhost myzhtc.com
......