{"id":540,"date":"2018-12-24T11:37:00","date_gmt":"2018-12-24T11:37:00","guid":{"rendered":"http:\/\/happily70.dothome.co.kr\/?p=540"},"modified":"2019-02-07T15:26:30","modified_gmt":"2019-02-07T15:26:30","slug":"is-null-is-not-null","status":"publish","type":"post","link":"http:\/\/happily70.dothome.co.kr\/?p=540","title":{"rendered":"IS NULL, IS NOT NULL"},"content":{"rendered":"<p><strong>NULL<\/strong><br \/>\n&#8211; DB\uc5d0\uc11c <strong>NULL\uc774 \uc77c\ubc18\uc801\uc778 \uac12\uacfc\ub294 \ub2e4\ub974\uac8c \ucde8\uae09\ub41c\ub2e4.<\/strong><br \/>\n&#8211; \uc544\uc9c1 \uc815\uc758\ub418\uc9c0 \uc54a\uc740 \uac12.<br \/>\n&#8211; 0(\uc22b\uc790) \ub610\ub294 \uacf5\ubc31(\ubb38\uc790)\uacfc \ub2e4\ub974\ub2e4.<br \/>\n&#8211; \ud14c\uc774\ube14\uc744 \uc0dd\uc131\ud560 \ub54c NOT NULL \ub610\ub294 PRIMARY KEY\ub85c \uc815\uc758\ub418\uc9c0 \uc54a\uc740 \ubaa8\ub4e0 \ub370\uc774\ud130 \uc720\ud615\uc740 \ub110 \uac12\uc744 \ud3ec\ud568\ud560 \uc218 \uc788\ub2e4.<br \/>\n&#8211; NULL \uac12\uc744 \ud3ec\ud568\ud558\ub294 \uc5f0\uc0b0\uc758 \uacbd\uc6b0 \uacb0\uacfc \uac12\ub3c4 NULL\uc774\ub2e4. \ubaa8\ub974\ub294 \ub370\uc774\ud130\uc5d0 \uc22b\uc790\ub97c \ub354\ud558\uac70\ub098 \ube7c\ub3c4 \uacb0\uacfc\ub294 \ub9c8\ucc2c\uac00\uc9c0\ub85c \ubaa8\ub974\ub294 \ub370\uc774\ud130\uc778 \uac83\uacfc \uac19\ub2e4.<br \/>\n&#8211; \uacb0\uacfc\uac12\uc744 NULL\uc774 \uc544\ub2cc \ub2e4\ub978 \uac12\uc744 \uc5bb\uace0\uc790 \ud560 \ub54c NVL\/ISNULL \ud568\uc218\ub97c \uc0ac\uc6a9\ud55c\ub2e4.<br \/>\n&#8211; NULL \uac12\uc758 \ub300\uc0c1\uc774 \uc22b\uc790 \uc720\ud615 \ub370\uc774\ud130\uc778 \uacbd\uc6b0\ub294 \uc8fc\ub85c 0(Zero)\uc73c\ub85c, \ubb38\uc790 \uc720\ud615 \ub370\uc774\ud130\uc778 \uacbd\uc6b0\uc5d0\ub294 \ube14\ub7ad\ud06c\ubcf4\ub2e4\ub294 &#8216;x&#8217; \uac19\uc740 \ud574\ub2f9 \uc2dc\uc2a4\ud15c\uc5d0\uc11c \uc758\ubbf8\uc5c6\ub294 \ubb38\uc790\ub85c \ubc14\uafb8\ub294 \uacbd\uc6b0\uac00 \ub9ce\ub2e4.<\/p>\n<p><strong>IS NULL<\/strong><\/p>\n<pre>\r\n-- NULL\uc778 \ub370\uc774\ud130\r\nSELECT *\r\nFROM test\r\nWHERE score IS NULL;\r\n<\/pre>\n<p><strong>IS NOT NULL<\/strong><\/p>\n<pre>\r\n-- NULL\uc774 \uc544\ub2cc \ub370\uc774\ud130\r\nSELECT *\r\nFROM test\r\nWHERE score IS NOT NULL;\r\n<\/pre>\n<p><strong>IFNULL<\/strong><\/p>\n<pre>\r\n-- NULL\uc774\uba74 0\uc73c\ub85c \uce58\ud658.\r\nSELECT IFNULL(score, 0) FROM test;\r\n<\/pre>\n<p><strong>COALESCE<\/strong><\/p>\n<pre>\r\n-- NULL\uc774\uba74 0\uc73c\ub85c \uce58\ud658.\r\nSELECT COALESCE(score, 0) FROM test;\r\n<\/pre>\n<pre>\r\n<strong>IFNULL\uacfc COALESCE \ucc28\uc774.<\/strong>\r\nCOALESCE() is in all the major databases, while IFNULL() isn't in SQL Server which uses ISNULL()instead. Performance should be no different. \u2013  Hart CO Nov 12 '14 at 18:56\r\n\uacb0\uacfc\ub294 \uac19\uc9c0\ub9cc. COALESCE\uac00 \ubaa8\ub4e0 \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0\uc11c \uc0ac\uc6a9\uac00\ub2a5\ud558\ub2c8 COALESCE\ub97c \uad8c\uc7a5\ud55c\ub2e4. \r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>NULL &#8211; DB\uc5d0\uc11c NULL\uc774 \uc77c\ubc18\uc801\uc778 \uac12\uacfc\ub294 \ub2e4\ub974\uac8c \ucde8\uae09\ub41c\ub2e4. &#8211; \uc544\uc9c1 \uc815\uc758\ub418\uc9c0 \uc54a\uc740 \uac12. &#8211; 0(\uc22b\uc790) \ub610\ub294 \uacf5\ubc31(\ubb38\uc790)\uacfc \ub2e4\ub974\ub2e4. &#8211; \ud14c\uc774\ube14\uc744 \uc0dd\uc131\ud560 \ub54c NOT NULL \ub610\ub294 PRIMARY KEY\ub85c \uc815\uc758\ub418\uc9c0 \uc54a\uc740 \ubaa8\ub4e0 \ub370\uc774\ud130 \uc720\ud615\uc740 \ub110 \uac12\uc744 \ud3ec\ud568\ud560 \uc218 \uc788\ub2e4. &#8211; NULL \uac12\uc744 \ud3ec\ud568\ud558\ub294 \uc5f0\uc0b0\uc758 \uacbd\uc6b0 \uacb0\uacfc \uac12\ub3c4 NULL\uc774\ub2e4. \ubaa8\ub974\ub294 \ub370\uc774\ud130\uc5d0 \uc22b\uc790\ub97c \ub354\ud558\uac70\ub098 \ube7c\ub3c4 \uacb0\uacfc\ub294 \ub9c8\ucc2c\uac00\uc9c0\ub85c \ubaa8\ub974\ub294 \ub370\uc774\ud130\uc778<\/p>\n<footer class=\"entry-footer index-entry\">\n<div class=\"post-social pull-left\"><a href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=http%3A%2F%2Fhappily70.dothome.co.kr%2F%3Fp%3D540\" target=\"_blank\" class=\"social-icons\"><i class=\"fa fa-facebook\" aria-hidden=\"true\"><\/i><\/a><a href=\"https:\/\/twitter.com\/home?status=http%3A%2F%2Fhappily70.dothome.co.kr%2F%3Fp%3D540\" target=\"_blank\" class=\"social-icons\"><i class=\"fa fa-twitter\" aria-hidden=\"true\"><\/i><\/a><a href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=http%3A%2F%2Fhappily70.dothome.co.kr%2F%3Fp%3D540&#038;title=IS+NULL%2C+IS+NOT+NULL\" target=\"_blank\" class=\"social-icons\"><i class=\"fa fa-linkedin\" aria-hidden=\"true\"><\/i><\/a><\/div>\n<p class=\"link-more\"><a href=\"http:\/\/happily70.dothome.co.kr\/?p=540\" class=\"more-link\">Continue reading <span class=\"meta-nav\">\u2192<\/span><\/a><\/p>\n<\/footer>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,33,64],"tags":[],"class_list":["post-540","post","type-post","status-publish","format-standard","hentry","category-back-end","category-developement","category-mysql"],"_links":{"self":[{"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/540"}],"collection":[{"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=540"}],"version-history":[{"count":4,"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/540\/revisions"}],"predecessor-version":[{"id":563,"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/540\/revisions\/563"}],"wp:attachment":[{"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=540"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/happily70.dothome.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}