{"Entry":{"collection":"func","key":"nullif","name":"NULLIF","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":true,"doc_overhaul":false,"from":"7.2","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"7.3"},{"descriptions_changed":true,"doc_overhaul":false,"from":"8.0","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"8.1"},{"descriptions_changed":true,"doc_overhaul":false,"from":"8.3","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"8.4"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"}],"content_hash":"b6882c5ecaa46990803c82dcbfeaf1abf1d46298ebeb323d831d6b7bb92780e0","first_version":"7.1","group":"conditional","group_label":"Conditional Expressions","groups":["conditional"],"imported_at":"2026-09-27T17:57:28.861254+08:00","last_version":"20","name":"NULLIF","name_key":"nullif","position":18003,"present_in":["7.1","7.2","7.3","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"signature":"NULLIF(value1, value2)","signature_count":1,"slug":"nullif","source_rev":"b7bd9cda","summary":"The NULLIF function returns a null value if value1 equals value2; otherwise it returns value1.","summary_zh":""}},"Definition":{"Collection":"func","Key":"nullif","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"nullif","SourceRevision":"b7bd9cda","Facts":{"description":"The NULLIF function returns a null value if value1 equals value2; otherwise it returns value1. This can be used to perform the inverse operation of the COALESCE example given above:","description_html":"The \u003ccode class=\"function\"\u003eNULLIF\u003c/code\u003e function returns a null value if \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue1\u003c/code\u003e\u003c/em\u003e equals \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue2\u003c/code\u003e\u003c/em\u003e; otherwise it returns \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue1\u003c/code\u003e\u003c/em\u003e. This can be used to perform the inverse operation of the \u003ccode class=\"function\"\u003eCOALESCE\u003c/code\u003e example given above:","description_zh":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-NULLIF","file":"functions-conditional.html","slug":"18"},"group":"conditional","group_label":"Conditional Expressions","lang":"en","layout":"table-new","pages":["functions-conditional.html"],"prose_only":false,"signatures":[{"description":"The NULLIF function returns a null value if value1 equals value2; otherwise it returns value1. This can be used to perform the inverse operation of the COALESCE example given above:","description_html":"The \u003ccode class=\"function\"\u003eNULLIF\u003c/code\u003e function returns a null value if \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue1\u003c/code\u003e\u003c/em\u003e equals \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue2\u003c/code\u003e\u003c/em\u003e; otherwise it returns \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue1\u003c/code\u003e\u003c/em\u003e. This can be used to perform the inverse operation of the \u003ccode class=\"function\"\u003eCOALESCE\u003c/code\u003e example given above:","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003eNULLIF\u003c/code\u003e(\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue1\u003c/code\u003e\u003c/em\u003e, \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue2\u003c/code\u003e\u003c/em\u003e)","returns":"","text":"NULLIF(value1, value2)","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-NULLIF","file":"functions-conditional.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"nullif","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"NULLIF","Summary":"当value1和value2相等时，NULLIF返回 null。否则它返回value1。这可以用于执行前文给出的COALESCE示例的逆操作：","BodyHTML":"当\u003cem\u003e\u003ccode\u003evalue1\u003c/code\u003e\u003c/em\u003e和\u003cem\u003e\u003ccode\u003evalue2\u003c/code\u003e\u003c/em\u003e相等时，\u003ccode\u003eNULLIF\u003c/code\u003e返回 null。否则它返回\u003cem\u003e\u003ccode\u003evalue1\u003c/code\u003e\u003c/em\u003e。这可以用于执行前文给出的\u003ccode\u003eCOALESCE\u003c/code\u003e示例的逆操作：\u003cpre\u003eNULLIF(value1, value2)\u003c/pre\u003e当\u003cem\u003e\u003ccode\u003evalue1\u003c/code\u003e\u003c/em\u003e和\u003cem\u003e\u003ccode\u003evalue2\u003c/code\u003e\u003c/em\u003e相等时，\u003ccode\u003eNULLIF\u003c/code\u003e返回 null。否则它返回\u003cem\u003e\u003ccode\u003evalue1\u003c/code\u003e\u003c/em\u003e。这可以用于执行前文给出的\u003ccode\u003eCOALESCE\u003c/code\u003e示例的逆操作：","SourceRevision":"ca936764","ContentHash":"f023bf8d075657a8538ba45ee441082f53070d1a706a088132916d2bf85dd1ed","Payload":{"description_zh":"当value1和value2相等时，NULLIF返回 null。否则它返回value1。这可以用于执行前文给出的COALESCE示例的逆操作：","description_zh_html":"当\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue1\u003c/code\u003e\u003c/em\u003e和\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue2\u003c/code\u003e\u003c/em\u003e相等时，\u003ccode class=\"function\"\u003eNULLIF\u003c/code\u003e返回 null。否则它返回\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue1\u003c/code\u003e\u003c/em\u003e。这可以用于执行前文给出的\u003ccode class=\"function\"\u003eCOALESCE\u003c/code\u003e示例的逆操作：","signatures":[{"description_zh":"当value1和value2相等时，NULLIF返回 null。否则它返回value1。这可以用于执行前文给出的COALESCE示例的逆操作：","description_zh_html":"当\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue1\u003c/code\u003e\u003c/em\u003e和\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue2\u003c/code\u003e\u003c/em\u003e相等时，\u003ccode class=\"function\"\u003eNULLIF\u003c/code\u003e返回 null。否则它返回\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue1\u003c/code\u003e\u003c/em\u003e。这可以用于执行前文给出的\u003ccode class=\"function\"\u003eCOALESCE\u003c/code\u003e示例的逆操作：","returns":"","text":"NULLIF(value1, value2)","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.1","7.2","7.3","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"6b46d6ffb555c28b01883b360be263d3afb5ff45572d8ba1813f6189904decdc","Text":"NULLIF(value1, value2)","Returns":"","Payload":{"description":"The NULLIF function returns a null value if value1 equals value2; otherwise it returns value1. This can be used to perform the inverse operation of the COALESCE example given above:","description_html":"The \u003ccode class=\"function\"\u003eNULLIF\u003c/code\u003e function returns a null value if \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue1\u003c/code\u003e\u003c/em\u003e equals \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue2\u003c/code\u003e\u003c/em\u003e; otherwise it returns \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue1\u003c/code\u003e\u003c/em\u003e. This can be used to perform the inverse operation of the \u003ccode class=\"function\"\u003eCOALESCE\u003c/code\u003e example given above:","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003eNULLIF\u003c/code\u003e(\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue1\u003c/code\u003e\u003c/em\u003e, \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue2\u003c/code\u003e\u003c/em\u003e)","returns":"","text":"NULLIF(value1, value2)","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
