mysqlÖÐnullºÍ¿ÕÖµµÄÇø±ð
nullÌåÏÖδ֪ÇÒÎÞÒâÒåµÄÖµ£¬¶ø¿ÕÖµÌåÏÖδ¸³Öµ»òδ³õʼ»¯µÄÖµ¡£Á½ÕߵIJî±ðÔÚÓÚ£ºÓïÒå²î±ð¡¢Êý¾Ý¿â´¦Àí·½·¨¡¢ÅÌÎÊÓÅ»¯Ó°Ïì¡¢Êý¾ÝÍêÕûÐÔÓ°Ï죬¿Éͨ¹ýmysqlÌṩµÄ²Ù×÷·ûÇø·Ö¡£
MySQL ÖÐ NULL ºÍ¿ÕÖµµÄ²î±ð
ʲôÊÇ NULL£¿
NULL ´ú±íÒ»¸öδ֪»òÎÞÒâÒåµÄÖµ¡£ËüÌåÏÖ²»±£´æÓÐÓÃÖµ¡£
ʲôÊÇ¿ÕÖµ£¿
¿ÕÖµÌåÏÖÒ»¸öδ¸³Öµ»òδ³õʼ»¯µÄÖµ¡£Ëü·×Æ綨ÊÇ NULL£¬µ«¿ÉÄÜÊÇ¡£
NULL Óë¿ÕÖµµÄ²î±ð
ÓïÒå²î±ð£ºNULL ÌåÏÖÍêÈ«²»±£´æÖµ£¬¶ø¿ÕÖµ¿ÉÄÜÌåÏÖÔÝʱµÄδ֪»òδ·ÖÅɵÄÖµ¡£
Êý¾Ý¿â´¦Àí£ºMySQL ½« NULL ÊÓΪһ¸öÌض¨µÄÖµ£¬¶ø½«¿ÕÖµÊÓΪȱʧ»òδ֪µÄÖµ¡£
ÅÌÎÊÓÅ»¯£ºNULL ¿ÉÒÔÓ°ÏìÅÌÎÊÓÅ»¯£¬ÓÉÓÚËüÊÇΨһµÄÖµ£¬¶ø¿ÕÖµ¿ÉÒÔ°üÀ¨ÖÖÖÖ¿ÉÄܵÄÚ¹ÊÍ¡£
Êý¾ÝÍêÕûÐÔ£ºNULL ¿ÉÒÔÓÃÓÚÔöÇ¿Êý¾ÝÍêÕûÐÔ£¬Ç¿ÖÆijЩ×ֶξßÓÐÖµ¡£
ʾÀý³¡¾°£º
¿Í»§ÐÕÃû×ֶΣºNULL ÌåÏָÿͻ§²»ÖªµÀÐÕÃû»òδÌṩÐÕÃû¡£¿ÕÖµÌåÏÖ¸Ã×Ö¶ÎÉÐδÌî³ä¡£
¶©µ¥ÈÕÆÚ×ֶΣºNULL ÌåÏÖ¶©µ¥ÉÐδÏ´¿ÕÖµÌåÏÖ¶©µ¥ÈÕÆÚÉÐδȷ¶¨¡£
ÔõÑùÇø·Ö NULL ºÍ¿ÕÖµ£¿
MySQL ÌṩÁË IS NULL ºÍ IS NOT NULL ²Ù×÷·ûÀ´¼ì²éÖµÊÇ·ñΪ NULL¡£¿ÕÖµÎÞ·¨Ê¹ÓÃÕâЩ²Ù×÷·û¼ì²â¡£
½áÂÛ£º
NULL ºÍ¿ÕÖµÔÚ MySQL ÖÐÊDzî±ðµÄ¿´·¨¡£NULL ÌåÏÖ²»±£´æÓÐÓÃÖµ£¬¶ø¿ÕÖµÌåÏÖδ¸³Öµ»òδ³õʼ»¯µÄÖµ¡£ÏàʶËüÃǵIJî±ð¹ØÓÚ׼ȷڹÊͺʹ¦ÀíÊý¾ÝÖÁ¹ØÖ÷Òª¡£
ÒÔÉϾÍÊÇmysqlÖÐnullºÍ¿ÕÖµµÄÇø±ðµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡