13 lines
774 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'"},
2019-01-08 11:36:16 +01:00
{ "expression":"nullif(\"name\", '')", "returns":"NULL, if name is an empty string (or already NULL), the name in any other case."} ]
}