Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQL Server¡¢OracleºÍMySQLÖвé³öֵΪNULLµÄÌæ»»

SOURCE: CLICK HERE
±¾ÎĽ²ÊöSQL Server¡¢Oracle¡¢MySQL²é³öֵΪNULLµÄÌæ»»¡£
ÔÚSQL Server Oracle MySQLµ±Êý¾Ý¿âÖвé³öijֵΪNULLÔõô°ì?
1¡¢MSSQL: ISNULL()
Óï·¨
ISNULL ( check_expression , replacement_value )
²ÎÊý
check_expression
½«±»¼ì²éÊÇ·ñΪ NULLµÄ±í´ïʽ¡£check_expression ¿ÉÒÔÊÇÈκÎÀàÐ͵ġ£
replacement_value
ÔÚ check_expression Ϊ NULLʱ½«·µ»ØµÄ±í´ïʽ¡£replacement_value ±ØÐëÓë check_expresssion ¾ßÓÐÏàͬµÄÀàÐÍ¡£
·µ»ØÀàÐÍ
·µ»ØÓë check_expression ÏàͬµÄÀàÐÍ¡£
×¢ÊÍ
Èç¹û check_expression ²»Îª NULL£¬ÄÇô·µ»Ø¸Ã±í´ïʽµÄÖµ£»·ñÔò·µ»Ø replacement_value¡£
2¡¢Oracle: NVL()
Óï·¨
NVL(eExpression1, eExpression2)
²ÎÊý
eExpression1, eExpression2
Èç¹û eExpression1 µÄ¼ÆËã½á¹ûΪ null Öµ£¬Ôò NVL() ·µ»Ø eExpression2¡£Èç¹û eExpression1 µÄ¼ÆËã½á¹û²»ÊÇ null Öµ£¬Ôò·µ»Ø eExpression1¡£eExpression1 ºÍ eExpression2 ¿ÉÒÔÊÇÈÎÒâÒ»ÖÖÊý¾ÝÀàÐÍ¡£Èç¹û eExpression1 Óë eExpression2 µÄ½á¹û½ÔΪ null Öµ£¬Ôò NVL( ) ·µ»Ø NULL
·µ»ØÖµÀàÐÍ
×Ö·ûÐÍ¡¢ÈÕÆÚÐÍ¡¢ÈÕÆÚʱ¼äÐÍ¡¢ÊýÖµÐÍ¡¢»õ±ÒÐÍ¡¢Âß¼­ÐÍ»ò null Öµ
˵Ã÷
ÔÚ²»Ö§³Ö null Öµ»ò null ÖµÎ޹ؽôÒªµÄÇé¿öÏ£¬¿ÉÒÔʹÓà NVL( ) À´ÒÆÈ¥¼ÆËã»ò²Ù×÷ÖÐµÄ null Öµ¡£
3¡¢Mysql: IFNULL()
Óï·¨
IFNULL(expr1,expr2)
²ÎÊý
expr1,expr2
¼ÙÈçexpr1²»ÊÇNULL£¬IFNULL()·µ»Øexpr1£¬·ñÔòËü·µ»Øexpr2¡£IFNULL()·µ»ØÒ»¸öÊý×Ö»ò×Ö·û´®Öµ£¬È¡¾öÓÚËü±»Ê¹ÓõÄÉÏÏÂÎÄ»·¾³¡£


Ïà¹ØÎĵµ£º

Ubuntu10.04Ï°²×°Oracle 10G






<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
-->
¹«ÍøÖÕÓÚͨµÄ£¬ÎÒµÄubuntu
Ò²ÖÕÓÚ¿ÉÒÔ¼ÌÐøʹÓÃÁË¡£¡£¡£


Ê×ÏȰѱ¾×ÓµÄubuntu
´Ó9.04
Éý¼¶µ½10.04
£¬·¢ÏÖϵͳ±ä³ÉÓ¢ºº»ìÓÃÁË£¬ÖØÑ¡ÓïÑÔÖ§³Ö°üÒ²²»¿ÉÒÔ£¬ÊäÈë·¨Ò²Ìí¼Ó²»ÉÏ£¬µ¹ÊÇûÓÐÍøÉÏÓÐÈËÌáµ½µÄϵͳÏìÓ¦·Ç³£»ºÂýµÄÎ ......

oracleǨÒƱí¿Õ¼ä

¿ÉǨÒƱí¿Õ¼ätransport tablespace
¿ÉǨÒƱí¿Õ¼ä
ʹÓÿÉǨÒƱí¿Õ¼ä(Transportable Tablespaces)µÄÌØÐÔÔÚÊý¾Ý¿âÖ®¼äÒƶ¯´óÁ¿Êý¾Ý£¬ÐÔÄܱÈexport/importºÍunload/loadÒª¿ìºÜ¶à£¬ÒòΪËüǨÒƱí¿Õ¼äÖ»ÐèÒª¸´ÖÆÊý¾ÝÎļþºÍ²åÈë±í¿Õ¼äÔªÊý¾Ýµ½Ä¿±êÊý¾Ý¿âÖС£
ǨÒƱí¿Õ¼ä¶ÔÒÔÏÂÓ¦ÓÃÌرðÓÐÓãº
·Ö½×¶Î½«OLTPµÄÊý¾ÝÒÆÈëÊý¾Ý²Ö¿â
¸ ......

oracle ´æ´¢¹ý³ÌµÄ»ù±¾Óï·¨ ¼°×¢ÒâÊÂÏî

oracle ´æ´¢¹ý³ÌµÄ»ù±¾Óï·¨ ¼°×¢ÒâÊÂÏî
oracle ´æ´¢¹ý³ÌµÄ»ù±¾Óï·¨
1.»ù±¾½á¹¹
CREATE OR REPLACE PROCEDURE ´æ´¢¹ý³ÌÃû×Ö
(
    ²ÎÊý1 IN NUMBER,
    ²ÎÊý2 IN NUMBER
) IS
±äÁ¿1 INTEGER :=0;
±äÁ¿2 DATE;
BEGIN
END ´æ´¢¹ý³ÌÃû×Ö
2.SELECT INTO STATEMENT
  ½«selec ......

Oracle¶àÐмǼºÏ²¢/Á¬½Ó/¾ÛºÏ×Ö·û´®µÄ¼¸ÖÖ·½·¨

ʲôÊǺϲ¢¶àÐÐ×Ö·û´®£¨Á¬½Ó×Ö·û´®£©ÄØ£¬ÀýÈ磺
SQL> desc test;
Name     Type          Nullable Default Comments
------- ------------ -------- ------- --------
COUNTRY VARCHAR2(20) Y       &nb ......

Oracle¶àÐмǼºÏ²¢/Á¬½Ó/¾ÛºÏ×Ö·û´®µÄ¼¸ÖÖ·½·¨

ʲôÊǺϲ¢¶àÐÐ×Ö·û´®£¨Á¬½Ó×Ö·û´®£©ÄØ£¬ÀýÈ磺
SQL> desc test;
Name     Type          Nullable Default Comments
------- ------------ -------- ------- --------
COUNTRY VARCHAR2(20) Y       &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ