Skip to content

Commit 5cb0058

Browse files
authored
Document "nullif" function (#6451)
1 parent d25401c commit 5cb0058

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
- [has](super-sql/functions/generics/has.md)
124124
- [len](super-sql/functions/generics/len.md)
125125
- [map](super-sql/functions/generics/map.md)
126+
- [nullif](super-sql/functions/generics/nullif.md)
126127
- [under](super-sql/functions/generics/under.md)
127128
- [Errors](super-sql/functions/errors/intro.md)
128129
- [error](super-sql/functions/errors/error.md)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
### Function
2+
3+
  **nullif** — returns a null value if values are equal
4+
5+
### Synopsis
6+
7+
```
8+
nullif(val1: any, val2: any) -> any
9+
```
10+
11+
### Description
12+
13+
The `nullif` function returns a `null` value if its first argument `val1` is
14+
equal to its second argument `val2`, otherwise it returns `val1`.
15+
16+
### Examples
17+
18+
---
19+
20+
```mdtest-spq
21+
# spq
22+
nullif(1, 1)
23+
# input
24+
25+
# expected output
26+
null::int64
27+
```
28+
29+
---
30+
31+
```mdtest-spq
32+
# spq
33+
nullif("foo", "bar")
34+
# input
35+
36+
# expected output
37+
"foo"
38+
```

0 commit comments

Comments
 (0)