ClickHouse/clickhouse-docs-embeddings huggingface dataset:
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/sql-reference/functions/index.md)

|  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Page Description|  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | | [Regular Functions](/docs/sql-reference/functions/regular-functions) Functions whose result for each row is independent of all other rows.|  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | | [Aggregate Functions](/docs/sql-reference/aggregate-functions) Functions that accumulate a set of values across rows.|  |  |  |  | | --- | --- | --- | --- | | [Table Functions](/docs/sql-reference/table-functions) Methods for constructing tables.|  |  | | --- | --- | | [Window Functions](/docs/sql-reference/window-functions) Functions which let you perform calculations across a set of rows that are related to the current row. | | | | | | | | | |

Was this page helpful?
Bit functions

**Examples**

**Usage example 1**

```
SELECT bitTestAll(43, 0, 1, 3, 5);
```

```
┌─bin(43)──┬─bitTestAll(43, 0, 1, 3, 5)─┐
│ 00101011 │                          1 │
└──────────┴────────────────────────────┘
```

**Usage example 2**

```
SELECT bitTestAll(43, 0, 1, 3, 5, 2);
```

```
┌─bin(43)──┬─bitTestAll(4⋯1, 3, 5, 2)─┐
│ 00101011 │                        0 │
└──────────┴──────────────────────────┘
```

## bitTestAny[​](#bitTestAny "Direct link to bitTestAny")

Introduced in: v1.1.0

Returns result of the [logical disjunction](https://en.wikipedia.org/wiki/Logical_disjunction) (OR operator) of all bits at the given positions in a number.
Counts right-to-left, starting at 0.

The logical OR between two bits is true if at least one of the input bits is true.

**Syntax**

```
bitTestAny(a, index1[, index2, ... , indexN])
```

**Arguments**

- `a` — An integer value. [`(U)Int8/16/32/64`](/docs/sql-reference/data-types/int-uint)
- `index1, ...` — One or multiple positions of bits. [`(U)Int8/16/32/64`](/docs/sql-reference/data-types/int-uint)

**Returned value**

Returns the result of the logical disjunction [`UInt8`](/docs/sql-reference/data-types/int-uint)

**Examples**

**Usage example 1**

```
SELECT bitTestAny(43, 0, 2);
```

```
┌─bin(43)──┬─bitTestAny(43, 0, 2)─┐
│ 00101011 │                    1 │
└──────────┴──────────────────────┘
```

**Usage example 2**

```
SELECT bitTestAny(43, 4, 2);
```

```
┌─bin(43)──┬─bitTestAny(43, 4, 2)─┐
│ 00101011 │                    0 │
└──────────┴──────────────────────┘
```

## bitXor[​](#bitXor "Direct link to bitXor")

Introduced in: v1.1.0

Performs bitwise exclusive or (XOR) operation between two values.

**Syntax**

```
bitXor(a, b)
```

**Arguments**

- `a` — First value. [`(U)Int*`](/docs/sql-reference/data-types/int-uint) or [`Float*`](/docs/sql-reference/data-types/float)
- `b` — Second value. [`(U)Int*`](/docs/sql-reference/data-types/int-uint) or [`Float*`](/docs/sql-reference/data-types/float)

**Returned value**

Returns the result of bitwise operation `a XOR b`

**Examples**

**Usage example**

```
CREATE TABLE bits
(
    `a` UInt8,
    `b` UInt8
)
ENGINE = Memory;

INSERT INTO bits VALUES (0, 0), (0, 1), (1, 0), (1, 1);

SELECT
    a,
    b,
    bitXor(a, b)
FROM bits;
```

```
┌─a─┬─b─┬─bitXor(a, b)─┐
│ 0 │ 0 │            0 │
│ 0 │ 1 │            1 │
│ 1 │ 0 │            1 │
│ 1 │ 1 │            0 │
└───┴───┴──────────────┘
```

- [bitAnd](#bitAnd)- [bitCount](#bitCount)- [bitHammingDistance](#bitHammingDistance)- [bitNot](#bitNot)- [bitOr](#bitOr)- [bitRotateLeft](#bitRotateLeft)- [bitRotateRight](#bitRotateRight)- [bitShiftLeft](#bitShiftLeft)- [bitShiftRight](#bitShiftRight)- [bitSlice](#bitSlice)- [bitTest](#bitTest)- [bitTestAll](#bitTestAll)- [bitTestAny](#bitTestAny)- [bitXor](#bitXor)

Was this page helpful?
Bitmap functions

## bitmapXorCardinality[​](#bitmapXorCardinality "Direct link to bitmapXorCardinality")

Introduced in: v20.1.0

Returns the cardinality of the XOR (symmetric difference) of two bitmaps.

**Syntax**

```
bitmapXorCardinality(bitmap1, bitmap2)
```

**Arguments**

- `bitmap1` — First bitmap object. [`AggregateFunction(groupBitmap, T)`](/docs/sql-reference/data-types/aggregatefunction). - `bitmap2` — Second bitmap object. [`AggregateFunction(groupBitmap, T)`](/docs/sql-reference/data-types/aggregatefunction).

**Returned value**

Returns the number of set bits in the symmetric difference of the two bitmaps [`UInt64`](/docs/sql-reference/data-types/int-uint)

**Examples**

**Usage example**

```
SELECT bitmapXorCardinality(bitmapBuild([1,2,3]), bitmapBuild([3,4,5])) AS res;
```

```
┌─res─┐
│   4 │
└─────┘
```

## subBitmap[​](#subBitmap "Direct link to subBitmap")

Introduced in: v21.9.0

Returns a subset of the bitmap, starting from position `offset`. The maximum cardinality of the returned bitmap is `cardinality_limit`.

**Syntax**

```
subBitmap(bitmap, offset, cardinality_limit)
```

**Arguments**

- `bitmap` — Bitmap object. [`AggregateFunction(groupBitmap, T)`](/docs/sql-reference/data-types/aggregatefunction). - `offset` — Number of set bits to skip from the beginning (zero-based). [`UInt32`](/docs/sql-reference/data-types/int-uint) - `cardinality_limit` — Maximum number of set bits to include in the subset. [`UInt32`](/docs/sql-reference/data-types/int-uint)

**Returned value**

Returns a bitmap containing at most `limit` set bits, starting after skipping `offset` set bits in ascending order [`AggregateFunction(groupBitmap, T)`](/docs/sql-reference/data-types/aggregatefunction)

**Examples**

**Usage example**

```
SELECT bitmapToArray(subBitmap(bitmapBuild([1, 2, 3, 4, 5]), 2, 2)) AS res;
```

```
┌─res────┐
│ [3, 4] │
└────────┘
```

- [bitmapAnd](#bitmapAnd)- [bitmapAndCardinality](#bitmapAndCardinality)- [bitmapAndnot](#bitmapAndnot)- [bitmapAndnotCardinality](#bitmapAndnotCardinality)- [bitmapBuild](#bitmapBuild)- [bitmapCardinality](#bitmapCardinality)- [bitmapContains](#bitmapContains)- [bitmapHasAll](#bitmapHasAll)- [bitmapHasAny](#bitmapHasAny)- [bitmapMax](#bitmapMax)- [bitmapMin](#bitmapMin)- [bitmapOr](#bitmapOr)- [bitmapOrCardinality](#bitmapOrCardinality)- [bitmapSubsetInRange](#bitmapSubsetInRange)- [bitmapSubsetLimit](#bitmapSubsetLimit)- [bitmapToArray](#bitmapToArray)- [bitmapTransform](#bitmapTransform)- [bitmapXor](#bitmapXor)- [bitmapXorCardinality](#bitmapXorCardinality)- [subBitmap](#subBitmap)

Was this page helpful?
Comparison functions

```
0
```

## notNullInIgnoreSet[​](#notNullInIgnoreSet "Direct link to notNullInIgnoreSet")

Introduced in: v1.1.0

Checks if the left operand is NOT a member of the right operand set. Unlike `notIn`, NULL values are not skipped: NULL is compared with set elements, and NULL = NULL evaluates to true.
This is the IgnoreSet variant used for type analysis without creating the set.

**Syntax**

```
notNullIn(x, set)
```

**Arguments**

- `x` — The value to check. - `set` — The set of values.

**Returned value**

Returns 1 if x is not in the set, 0 otherwise. [`UInt8`](/docs/sql-reference/data-types/int-uint)

**Examples**

**Basic usage**

```
SELECT notNullIn(NULL, tuple(1, NULL))
```

```
0
```

## nullIn[​](#nullIn "Direct link to nullIn")

Introduced in: v1.1.0

Checks if the left operand is a member of the right operand set. Unlike `in`, NULL values are not skipped: NULL is compared with set elements, and NULL = NULL evaluates to true.

**Syntax**

```
nullIn(x, set)
```

**Arguments**

- `x` — The value to check. - `set` — The set of values.

**Returned value**

Returns 1 if x is in the set, 0 otherwise. [`UInt8`](/docs/sql-reference/data-types/int-uint)

**Examples**

**Basic usage**

```
SELECT nullIn(NULL, tuple(1, NULL))
```

```
1
```

## nullInIgnoreSet[​](#nullInIgnoreSet "Direct link to nullInIgnoreSet")

Introduced in: v1.1.0

Checks if the left operand is a member of the right operand set. Unlike `in`, NULL values are not skipped: NULL is compared with set elements, and NULL = NULL evaluates to true.
This is the IgnoreSet variant used for type analysis without creating the set.

**Syntax**

```
nullIn(x, set)
```

**Arguments**

- `x` — The value to check. - `set` — The set of values.

**Returned value**

Returns 1 if x is in the set, 0 otherwise. [`UInt8`](/docs/sql-reference/data-types/int-uint)

**Examples**

**Basic usage**

```
SELECT nullIn(NULL, tuple(1, NULL))
```

```
1
```

- [Comparison rules](#comparison-rules)- [equals](#equals)- [globalIn](#globalIn)- [globalInIgnoreSet](#globalInIgnoreSet)- [globalNotIn](#globalNotIn)- [globalNotInIgnoreSet](#globalNotInIgnoreSet)- [globalNotNullIn](#globalNotNullIn)- [globalNotNullInIgnoreSet](#globalNotNullInIgnoreSet)- [globalNullIn](#globalNullIn)- [globalNullInIgnoreSet](#globalNullInIgnoreSet)- [greater](#greater)- [greaterOrEquals](#greaterOrEquals)- [in](#in)- [inIgnoreSet](#inIgnoreSet)- [isDistinctFrom](#isDistinctFrom)- [isNotDistinctFrom](#isNotDistinctFrom)- [less](#less)- [lessOrEquals](#lessOrEquals)- [notEquals](#notEquals)- [notIn](#notIn)- [notInIgnoreSet](#notInIgnoreSet)- [notNullIn](#notNullIn)- [notNullInIgnoreSet](#notNullInIgnoreSet)- [nullIn](#nullIn)- [nullInIgnoreSet](#nullInIgnoreSet)

Was this page helpful?
Conditional functions

**Returned value**

Returns the result of `then_N` for matching `cond_N`, otherwise returns the `else` condition.

**Examples**

**Example usage**

```
CREATE TABLE LEFT_RIGHT (left Nullable(UInt8), right Nullable(UInt8)) ENGINE = Memory;
INSERT INTO LEFT_RIGHT VALUES (NULL, 4), (1, 3), (2, 2), (3, 1), (4, NULL);

SELECT
    left,
    right,
    multiIf(left < right, 'left is smaller', left > right, 'left is greater', left = right, 'Both equal', 'Null value') AS result
FROM LEFT_RIGHT;
```

```
┌─left─┬─right─┬─result──────────┐
│ ᴺᵁᴸᴸ │     4 │ Null value      │
│    1 │     3 │ left is smaller │
│    2 │     2 │ Both equal      │
│    3 │     1 │ left is greater │
│    4 │  ᴺᵁᴸᴸ │ Null value      │
└──────┴───────┴─────────────────┘
```

- [Overview](#overview)
  - [Using Conditional Results Directly](#using-conditional-results-directly)- [NULL Values in Conditionals](#null-values-in-conditionals)- [CASE statement](#case-statement)- [clamp](#clamp)- [greatest](#greatest)- [if](#if)- [least](#least)- [multiIf](#multiIf)

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/sql-reference/functions/files.md)

## file[​](#file "Direct link to file")

Reads a file as string and loads the data into the specified column. The file content is not interpreted.

Also see table function [file](/docs/sql-reference/table-functions/file).

**Syntax**

```
file(path[, default])
```

**Arguments**

- `path` — The path of the file relative to [user\_files\_path](/docs/operations/server-configuration-parameters/settings#user_files_path). Supports wildcards `*`, `**`, `?`, `{abc,def}` and `{N..M}` where `N`, `M` are numbers and `'abc', 'def'` are strings.
- `default` — The value returned if the file does not exist or cannot be accessed. Supported data types: [String](/docs/sql-reference/data-types/string) and [NULL](/docs/operations/settings/formats#input_format_null_as_default).

**Example**

Inserting data from files a.txt and b.txt into a table as strings:

```
INSERT INTO table SELECT file('a.txt'), file('b.txt');
```

- [file](#file)

Was this page helpful?
Financial functions

**Returned value**

Returns the net present value as a Float64 value. [`Float64`](/docs/sql-reference/data-types/float)

**Examples**

**Basic usage**

```
SELECT financialNetPresentValueExtended(0.1, [-10000., 5750., 4250., 3250.], [toDate('2020-01-01'), toDate('2020-03-01'), toDate('2020-10-30'), toDate('2021-02-15')])
```

```
2506.579458169746
```

**Using different day count convention**

```
SELECT financialNetPresentValueExtended(0.1, [-10000., 5750., 4250., 3250.], [toDate('2020-01-01'), toDate('2020-03-01'), toDate('2020-10-30'), toDate('2021-02-15')], 'ACT_365_25')
```

```
2507.067268742502
```

## Related resources[​](#related-resources "Direct link to Related resources")

- [Financial functions in ClickHouse video](https://www.youtube.com/watch?v=BePLPVa0w_o)

- [financialInternalRateOfReturn](#financialInternalRateOfReturn)- [financialInternalRateOfReturnExtended](#financialInternalRateOfReturnExtended)- [financialNetPresentValue](#financialNetPresentValue)- [financialNetPresentValueExtended](#financialNetPresentValueExtended)- [Related resources](#related-resources)

Was this page helpful?
Functions for working with nullable values

INSERT INTO t_null VALUES (1, NULL), (2, 0), (3, 3);

SELECT x FROM t_null WHERE isZeroOrNull(y);
```

```
┌─x─┐
│ 1 │
│ 2 │
└───┘
```

## nullIf[​](#nullIf "Direct link to nullIf")

Introduced in: v1.1.0

Returns `NULL` if both arguments are equal.

**Syntax**

```
nullIf(x, y)
```

**Arguments**

- `x` — The first value. [`Any`](/docs/sql-reference/data-types)
- `y` — The second value. [`Any`](/docs/sql-reference/data-types)

**Returned value**

Returns `NULL` if both arguments are equal, otherwise returns the first argument. [`NULL`](/docs/sql-reference/syntax#null) or [`Nullable(x)`](/docs/sql-reference/data-types/nullable)

**Examples**

**Usage example**

```
SELECT nullIf(1, 1), nullIf(1, 2);
```

```
┌─nullIf(1, 1)─┬─nullIf(1, 2)─┐
│         ᴺᵁᴸᴸ │            1 │
└──────────────┴──────────────┘
```

## toNullable[​](#toNullable "Direct link to toNullable")

Introduced in: v1.1.0

Converts the provided argument type to `Nullable`.

**Syntax**

```
toNullable(x)
```

**Arguments**

- `x` — A value of any non-compound type. [`Any`](/docs/sql-reference/data-types)

**Returned value**

Returns the input value but of `Nullable` type. [`Nullable(Any)`](/docs/sql-reference/data-types/nullable)

**Examples**

**Usage example**

```
SELECT toTypeName(10), toTypeName(toNullable(10));
```

```
┌─toTypeName(10)─┬─toTypeName(toNullable(10))─┐
│ UInt8          │ Nullable(UInt8)            │
└────────────────┴────────────────────────────┘
```

- [assumeNotNull](#assumeNotNull)- [coalesce](#coalesce)- [firstNonDefault](#firstNonDefault)- [ifNull](#ifNull)- [isNotNull](#isNotNull)- [isNull](#isNull)- [isNullable](#isNullable)- [isZeroOrNull](#isZeroOrNull)- [nullIf](#nullIf)- [toNullable](#toNullable)

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/sql-reference/functions/geo/index.md)

Functions for working with geometric objects, for example [to calculate distances between points on a sphere](/docs/sql-reference/functions/geo/coordinates), [compute geohashes](/docs/sql-reference/functions/geo/geohash), and work with [h3 indexes](/docs/sql-reference/functions/geo/h3).

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/sql-reference/functions/geo/flipCoordinates.md)

## flipCoordinates[​](#flipcoordinates "Direct link to flipCoordinates")

The `flipCoordinates` function swaps the coordinates of a point, ring, polygon, or multipolygon. This is useful, for example, when converting between coordinate systems where the order of latitude and longitude differs.

```
flipCoordinates(coordinates)
```

### Input Parameters[​](#input-parameters "Direct link to Input Parameters")

- `coordinates` — A tuple representing a point `(x, y)`, or an array of such tuples representing a ring, polygon, or multipolygon. Supported input types include:
  - [**Point**](/docs/sql-reference/data-types/geo#point): A tuple `(x, y)` where `x` and `y` are [Float64](/docs/sql-reference/data-types/float) values.
  - [**Ring**](/docs/sql-reference/data-types/geo#ring): An array of points `[(x1, y1), (x2, y2), ...]`.
  - [**Polygon**](/docs/sql-reference/data-types/geo#polygon): An array of rings `[ring1, ring2, ...]`, where each ring is an array of points.
  - [**Multipolygon**](/docs/sql-reference/data-types/geo#multipolygon): An array of polygons `[polygon1, polygon2, ...]`.

### Returned Value[​](#returned-value "Direct link to Returned Value")

The function returns the input with the coordinates flipped. For example:

- A point `(x, y)` becomes `(y, x)`.
- A ring `[(x1, y1), (x2, y2)]` becomes `[(y1, x1), (y2, x2)]`.
- Nested structures like polygons and multipolygons are processed recursively.

### Examples[​](#examples "Direct link to Examples")

#### Example 1: Flipping a Single Point[​](#example-1 "Direct link to Example 1: Flipping a Single Point")

```
SELECT flipCoordinates((10, 20)) AS flipped_point
```

```
┌─flipped_point─┐
│ (20,10)       │
└───────────────┘
```

#### Example 2: Flipping an Array of Points (Ring)[​](#example-2 "Direct link to Example 2: Flipping an Array of Points (Ring)")

```
SELECT flipCoordinates([(10, 20), (30, 40)]) AS flipped_ring
```

```
┌─flipped_ring──────────────┐
│ [(20,10),(40,30)]         │
└───────────────────────────┘
```

#### Example 3: Flipping a Polygon[​](#example-3 "Direct link to Example 3: Flipping a Polygon")

```
SELECT flipCoordinates([[(10, 20), (30, 40)], [(50, 60), (70, 80)]]) AS flipped_polygon
```

```
┌─flipped_polygon──────────────────────────────┐
│ [[(20,10),(40,30)],[(60,50),(80,70)]]        │
└──────────────────────────────────────────────┘
```

#### Example 4: Flipping a Multipolygon[​](#example-4 "Direct link to Example 4: Flipping a Multipolygon")

```
SELECT flipCoordinates([[[10, 20], [30, 40]], [[50, 60], [70, 80]]]) AS flipped_multipolygon
```

```
┌─flipped_multipolygon──────────────────────────────┐
│ [[[20,10],[40,30]],[[60,50],[80,70]]]             │
└───────────────────────────────────────────────────┘
```

- [flipCoordinates](#flipcoordinates)
  - [Input Parameters](#input-parameters)- [Returned Value](#returned-value)- [Examples](#examples)

Was this page helpful?
title_wip

```
MULTIPOLYGON(((4.36661 50.8434,4.36623 50.8408,4.34496 50.8333,4.33807 50.8487,4.34669 50.8583,4.35268 50.8567,4.36136 50.8652,4.36131 50.8651,4.39045 50.8565,4.38303 50.8429,4.36661 50.8434)))
```

### Input parameters[​](#input-parameters-14 "Direct link to Input parameters")

Polygons

### Returned value[​](#returned-value-21 "Direct link to Returned value")

MultiPolygon

## polygonPerimeterSpherical[​](#polygonperimeterspherical "Direct link to polygonPerimeterSpherical")

Calculates the perimeter of the polygon.

### Example[​](#example-22 "Direct link to Example")

#### Polygon representing Zimbabwe[​](#polygon-representing-zimbabwe "Direct link to Polygon representing Zimbabwe")

This is the polygon representing Zimbabwe:
title_wip

```
0.45539
```

### Input parameters[​](#input-parameters-15 "Direct link to Input parameters")

### Returned value[​](#returned-value-22 "Direct link to Returned value")

## polygonsIntersectionCartesian[​](#polygonsintersectioncartesian "Direct link to polygonsIntersectionCartesian")

Calculates the intersection of polygons.

### Example[​](#example-23 "Direct link to Example")

```
SELECT wkt(polygonsIntersectionCartesian([[[(0., 0.), (0., 3.), (1., 2.9), (2., 2.6), (2.6, 2.), (2.9, 1.), (3., 0.), (0., 0.)]]], [[[(1., 1.), (1., 4.), (4., 4.), (4., 1.), (1., 1.)]]]))
```

```
MULTIPOLYGON(((1 2.9,2 2.6,2.6 2,2.9 1,1 1,1 2.9)))
```

### Input parameters[​](#input-parameters-16 "Direct link to Input parameters")

Polygons

### Returned value[​](#returned-value-23 "Direct link to Returned value")

MultiPolygon

## polygonAreaCartesian[​](#polygonareacartesian "Direct link to polygonAreaCartesian")

Calculates the area of a polygon

### Example[​](#example-24 "Direct link to Example")

```
SELECT polygonAreaCartesian([[[(0., 0.), (0., 5.), (5., 5.), (5., 0.)]]])
```

```
25
```

### Input parameters[​](#input-parameters-17 "Direct link to Input parameters")

Polygon

### Returned value[​](#returned-value-24 "Direct link to Returned value")

Float64

## polygonPerimeterCartesian[​](#polygonperimetercartesian "Direct link to polygonPerimeterCartesian")

Calculates the perimeter of a polygon.

### Example[​](#example-25 "Direct link to Example")

```
SELECT polygonPerimeterCartesian([[[(0., 0.), (0., 5.), (5., 5.), (5., 0.)]]])
```

```
15
```

### Input parameters[​](#input-parameters-18 "Direct link to Input parameters")

Polygon

### Returned value[​](#returned-value-25 "Direct link to Returned value")

Float64

## polygonsUnionCartesian[​](#polygonsunioncartesian "Direct link to polygonsUnionCartesian")

Calculates the union of polygons.

### Example[​](#example-26 "Direct link to Example")

```
SELECT wkt(polygonsUnionCartesian([[[(0., 0.), (0., 3.), (1., 2.9), (2., 2.6), (2.6, 2.), (2.9, 1), (3., 0.), (0., 0.)]]], [[[(1., 1.), (1., 4.), (4., 4.), (4., 1.), (1., 1.)]]]))
```

```
MULTIPOLYGON(((1 2.9,1 4,4 4,4 1,2.9 1,3 0,0 0,0 3,1 2.9)))
```

### Input parameters[​](#input-parameters-19 "Direct link to Input parameters")

Polygons

### Returned value[​](#returned-value-26 "Direct link to Returned value")

MultiPolygon

For more information on geometry systems, see this [presentation](https://archive.fosdem.org/2020/schedule/event/working_with_spatial_trajectories_in_boost_geometry/attachments/slides/3988/export/events/attachments/working_with_spatial_trajectories_in_boost_geometry/slides/3988/FOSDEM20_vissarion.pdf) about the Boost library, which is what ClickHouse uses.
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/sql-reference/functions/geo/svg.md)

## Svg[​](#svg "Direct link to Svg")

Returns a string of select SVG element tags from Geo data.

**Syntax**

```
Svg(geometry,[style])
```

Aliases: `SVG`, `svg`

**Parameters**

- `geometry` — Geo data. [Geo](/docs/sql-reference/data-types/geo).
- `style` — Optional style name. [String](/docs/sql-reference/data-types/string).

**Returned value**

- The SVG representation of the geometry. [String](/docs/sql-reference/data-types/string).
  - SVG circle
  - SVG polygon
  - SVG path

**Examples**

**Circle**

Query:

```
SELECT SVG((0., 0.))
```

Result:

```
<circle cx="0" cy="0" r="5" style=""/>
```

**Polygon**

Query:

```
SELECT SVG([(0., 0.), (10, 0), (10, 10), (0, 10)])
```

Result:

```
<polygon points="0,0 0,10 10,10 10,0 0,0" style=""/>
```

**Path**

Query:

```
SELECT SVG([[(0., 0.), (10, 0), (10, 10), (0, 10)], [(4., 4.), (5, 4), (5, 5), (4, 5)]])
```

Result:

```
<g fill-rule="evenodd"><path d="M 0,0 L 0,10 L 10,10 L 10,0 L 0,0M 4,4 L 5,4 L 5,5 L 4,5 L 4,4 z " style=""/></g>
```

- [Svg](#svg)

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/sql-reference/functions/in-functions.md)

## in, notIn, globalIn, globalNotIn[​](#in-notin-globalin-globalnotin "Direct link to in, notIn, globalIn, globalNotIn")

See the section [IN operators](/docs/sql-reference/operators/in).

- [in, notIn, globalIn, globalNotIn](#in-notin-globalin-globalnotin)

Was this page helpful?