Skip to content

Commit b6c3fb1

Browse files
committed
Document "nullif" function
1 parent b052b97 commit b6c3fb1

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-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: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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 the value of `val1` is
15+
returned.
16+
17+
### Examples
18+
19+
---
20+
21+
```mdtest-spq
22+
# spq
23+
nullif(1, 1)
24+
# input
25+
26+
# expected output
27+
null::int64
28+
```
29+
30+
---
31+
32+
```mdtest-spq
33+
# spq
34+
nullif("foo", "bar")
35+
# input
36+
37+
# expected output
38+
"foo"
39+
```

0 commit comments

Comments
 (0)