未验证 提交 9ca700ee 编写于 作者: A alexey-milovidov 提交者: GitHub

Merge pull request #9941 from BayoNet/docs/CLICKHOUSEDOCS-138-regionToTopContinent

DOCS-138: regionToTopContinent
......@@ -100,6 +100,30 @@ Example: `regionToCountry(toUInt32(213)) = 225` converts Moscow (213) to Russia
Converts a region to a continent. In every other way, this function is the same as ‘regionToCity’.
Example: `regionToContinent(toUInt32(213)) = 10001` converts Moscow (213) to Eurasia (10001).
### regionToTopContinent (#regiontotopcontinent)
Finds the highest continent in the hierarchy for the region.
**Syntax**
```sql
regionToTopContinent(id[, geobase]);
```
**Parameters**
- `id` — Region ID from the Yandex geobase. [UInt32](../../data_types/int_uint.md).
- `geobase` — Dictionary key. See [Multiple Geobases](#multiple-geobases). [String](../../data_types/string.md). Optional.
**Returned value**
- Identifier of the top level continent (the latter when you climb the hierarchy of regions).
- 0, if there is none.
Type: `UInt32`.
### regionToPopulation(id\[, geobase\]) {#regiontopopulationid-geobase}
Gets the population for a region.
......
......@@ -101,6 +101,28 @@ LIMIT 15
Переводит регион в континент. В остальном, аналогично функции regionToCity.
Пример: `regionToContinent(toUInt32(213)) = 10001` - преобразовали Москву (213) в Евразию (10001).
### regionToTopContinent (#regiontotopcontinent)
Находит для региона верхний в иерархии континент.
**Синтаксис**
```sql
regionToTopContinent(id[, geobase]);
```
**Параметры**
- `id` — Идентификатор региона из геобазы Яндекса. [UInt32](../../data_types/int_uint.md).
- `geobase` — Ключ словаря. Смотрите [Множественные геобазы](#multiple-geobases). [String](../../data_types/string.md). Опциональный параметр.
**Возвращаемое значение**
- Идентификатор континента верхнего уровня (последний при подъеме по иерархии регионов).
- 0, если его нет.
Тип: `UInt32`.
### regionToPopulation(id\[, geobase\]) {#regiontopopulationid-geobase}
Получает население для региона.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册