sqlÖпÕÖµÓÃʲôÌåÏÖ
sql ÖпÕÖµÌåÏÖΪ null£¬ÌåÏÖÖµ²»±£´æ»òδ֪£¬Ëü²î±ðÓÚ 0 »ò¿Õ×Ö·û´®¡£null ¿ÉÓëÈκÎÊý¾ÝÀàÐ;ÙÐнÏÁ¿£¬µ«ÔÚÂß¼ÔËËãÖÐÌåÏÖΪ¼ÙÖµ¡£ÔÚijЩ¾ÛºÏº¯ÊýÖб»ºöÂÔ£¬Èç sum() ºÍ count()¡£ÐèҪעÖصÄÊÇ£¬null ²»¿ÉÓëÆäËûÖµÏàµÈ£¬²»¿ÉÓÃÓÚÊýѧÔËË㣬ÔÚijЩÇéÐÎÏ¿ÉÄܵ¼Ö½û¾øÈ·µÄЧ¹û¡£
SQLÖпÕÖµµÄÌåÏÖ
SQLÖÐÓÃNULLÌåÏÖ¿ÕÖµ¡£
¼ÄÒå
NULLÌåÏÖÒ»¸öÖµ²»±£´æ»òδ֪¡£ËüÓëÖµ0»ò¿Õ×Ö·û´®²î±ð£¬ÓÉÓÚ0ÊÇÓÐÓÃÖµ£¬¶ø¿Õ×Ö·û´®ÊÇ·Ç¿ÕÖµ¡£
ʹÓÃ
½ÏÁ¿£ºNULL¿ÉÒÔÓëÈκÎÊý¾ÝÀàÐ;ÙÐнÏÁ¿£¬Ð§¹û×ÜÊÇNULL¡£
Âß¼ÔËË㣺NULLÔÚÂß¼ÔËËãÖÐÌåÏÖΪ¼ÙÖµ¡£
¾ÛºÏº¯Êý£ºNULLÔÚijЩ¾ÛºÏº¯ÊýÖб»ºöÂÔ£¬ÈçSUM()ºÍCOUNT()¡£
×¢ÖØÊÂÏî
NULL²»¿ÉÓëÆäËûÖµÏàµÈ£¨×ÝÈ»ÊÇNULL£©¡£
NULL²»¿ÉÓÃÓÚÊýѧÔËË㣬ÓÉÓÚÕâ»á·µ»ØNULL¡£
ÔÚijЩÇéÐÎÏ£¬NULL¿ÉÄܵ¼ÖÂÅÌÎÊЧ¹û½û¾øÈ·£¬Òò´ËÔÚʹÓÃʱӦСÐÄ¡£
ÒÔÉϾÍÊÇsqlÖпÕÖµÓÃʲôÌåÏÖµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡