Merge pull request #62469 from peter279k/add_uptime_func_usage

Document function `uptime`
This commit is contained in:
Konstantin Bogdanov 2024-04-10 13:00:24 +00:00 committed by GitHub
commit 84e3e64778
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -916,6 +916,34 @@ Returns the larger value of a and b.
Returns the servers uptime in seconds.
If executed in the context of a distributed table, this function generates a normal column with values relevant to each shard. Otherwise it produces a constant value.
**Syntax**
``` sql
uptime()
```
**Returned value**
- Time value of seconds.
Type: [UInt32](/docs/en/sql-reference/data-types/int-uint.md).
**Example**
Query:
``` sql
SELECT uptime() as Uptime;
```
Result:
``` response
┌─Uptime─┐
│ 55867 │
└────────┘
```
## version()
Returns the current version of ClickHouse as a string in the form of: