Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
846 B
Plaintext
Raw Normal View History

{
"name": "nullif",
"type": "function",
2020-07-02 01:46:48 +01:00
"groups": ["Conditionals"],
"description": "Returns a NULL value if value1 equals value2; otherwise it returns value1. This can be used to conditionally substitute values with NULL.",
"arguments": [{
"arg": "value1",
"description": "The value that should either be used or substituted with NULL."
}, {
"arg": "value2",
"description": "The control value that will trigger the NULL substitution."
}],
"examples": [{
"expression": "nullif('(none)', '(none)')",
"returns": "NULL"
}, {
"expression": "nullif('text', '(none)')",
"returns": "'text'"
}, {
"expression": "nullif(\"name\", '')",
"returns": "NULL, if name is an empty string (or already NULL), the name in any other case."
}],
"tags": ["substitute", "equals", "condition", "compare"]
}