Skip to content

Commit

Permalink
add functions example
Browse files Browse the repository at this point in the history
  • Loading branch information
nwoolmer committed Dec 2, 2024
1 parent e88c043 commit 0a7aab1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions documentation/reference/sql/declare.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,23 @@ SELECT @x + @y
|--------|
| 7 |

### Variables as functions

A variable need not be just a constant, it could be a function call,
and variables with function values can be nested:

```questdb-sql title="declaring function variable" demo
DECLARE
@today := today(),
@start := interval_start(@today),
@end := interval_end(@today)
SELECT @today = interval(@start, @end)
```

| column |
|--------|
| true |


### Declarations in subqueries

Expand Down

0 comments on commit 0a7aab1

Please sign in to comment.