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()·µ»ØÒ»¸öÊý×Ö»ò×Ö·û´®Öµ£¬È¡¾öÓÚËü±»Ê¹ÓõÄÉÏÏÂÎÄ»·¾³¡£
Ïà¹ØÎĵµ£º
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/cosio/archive/2009/03/11/3978747.aspx
ÓÐÁ½ÖÖº¬ÒåµÄ±í´óС¡£Ò»ÖÖÊÇ·ÖÅä¸øÒ»¸ö±íµÄÎïÀí¿Õ¼äÊýÁ¿£¬¶ø²»¹Ü¿Õ¼äÊÇ·ñ±»Ê¹Ó᣿ÉÒÔÕâÑù²éѯ»ñµÃ×Ö½ÚÊý£º
select segment_name, bytes
from user_segments
where segment_type = 'TABLE';
»òÕß
Sel ......
Oracle¶Ô±í×öÈ«±íɨÃèµÄʱºò
£¬»áɨÃèÍêHWMÒÔÏÂ
µÄÊý¾Ý¿é¡£Èç¹ûij¸ö±ídelete(delete²Ù×÷²»»á½µµÍ¸ßˮλ)ÁË´óÁ¿Êý¾Ý£¬ÄÇôÕâʱ¶Ô±í×öÈ«±íɨÃè¾Í»á×öºÜ¶àÎÞÓù¦£¬É¨ÃèÁËÒ»´ó¶ÑÊý¾Ý¿é£¬×îºó·¢ÏÖ¿éÀïÃæ¾ÓȻûÓÐÊý¾Ý¡£
ͨ³££¬ÔÚ¶Ô±í×öÁË´óÅúÁ¿delete²Ù×÷Ö®ºó£¬¾ÍÓ¦¸ÃÂíÉϽµµÍ±íµÄ¸ßˮ룬¿ÉÒÔʹÓÃshrink ÃüÁî»òÕßalter&n ......
author£ºskate
time£º2010-05-26
Oracle DBA ±ÊÊÔÌâ
£¨´ðÌâʱ¼ä60·ÖÖÓ£©
ÍøÉÏ¿´¼ûһƪDBAµÄÃæÊÔÌ⣬¾õµÃͦʵÓõģ¬¶ø²»ÏñÓеÄÃæÊÔŪµÃºÜÐ飬ºÜÀíÏ뻯¡£
Unix/Linux퉀1¡¢ÈçºÎ²é¿´Ö÷»úcpu£¬ÄÚ´æ¡¢IPºÍ´ÅÅÌ¿Õ¼ä?
2¡¢Äã³£ÓõĽø³Ì¹ÜÀí¡¢Ö÷»úÐÔÄܲ쿴ÃüÁîÓÐÄÄЩ£¿
3¡¢½¨Á¢×édbaºÍ¸Ã×éÏÂÓû§oracle£¬Ä¬ÈÏshellΪbash¡£ ......
ÔÚoracleÖУ¬ÎÒÃÇ´´½¨Ò»¸öÖ÷¼ü£¬Ôòͬʱ×Ô¶¯´´½¨ÁËÒ»¸öͬÃûµÄΨһË÷Òý£»É¾³ýÖ÷¼ü£¬ÔòÖ÷¼üÔ¼ÊøºÍ¶ÔÓ¦µÄΨһË÷Òý¶¼É¾³ýÁË¡£ÕâÊÇÎÒÃǾ³£¼ûµ½µÄÏÖÏó¡£
·¢³öÒ»¸ö´´½¨Ö÷¼üµÄsql£¬oracleÆäʵִÐÐÁËÁ½²½£º´´½¨Ö÷¼üÔ¼Êø¡¢´´½¨/¹ØÁª ΨһË÷Òý¡£²½ÖèÊÇÕâÑùµÄ£º
´´½¨Ö÷¼üÔ¼Êøʱ£¬¼ì²é¸ÃÖ÷¼ü×Ö¶ÎÉÏÊÇ·ñÒѾ´æÔÚΨһË÷Òý¡£Èô² ......
1£¬segments µÄ·ÖÀà
l
Êý¾Ý¶Î
l
Ë÷Òý¶Î
l
ÁÙʱ¶Î
l
»ØÍË ......