Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Blog
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
Yandex project
© 2023 Intertech Services AG
Yandex DataLens
  • Getting started
  • Practical guidelines
  • Concepts
  • Step-by-step instructions
  • Access management
  • Pricing policy
  • Visualization reference
  • Function reference
    • All Functions
    • Aggregate functions
    • Array functions
    • Date/Time functions
    • Logical functions
    • Mathematical functions
    • Operators
    • String functions
    • Text markup functions
    • Time series functions
    • Type conversion functions
      • Overview
      • BOOL
      • DATE
      • DATETIME
      • DATETIME_PARSE
      • DATE_PARSE
      • DB_CAST
      • FLOAT
      • GEOPOINT
      • GEOPOLYGON
      • INT
      • STR
    • Window functions
    • Function Availability
  • Function tutorials
  • Educational projects
  • Troubleshooting
    • Questions and answers
    • DataLens errors
  1. Function reference
  2. Type conversion functions
  3. STR

STR

Written by
Yandex Cloud
,
improved by
amatol

    Syntax

    STR( expression )
    

    Description

    Converts the expression expression to string type.

    Argument types:

    • expression — Array of fractional numbers | Array of integers | Array of strings | Boolean | Date | Datetime | Fractional number | Geopoint | Geopolygon | Integer | String | UUID

    Return type: String

    Note

    If an array is passed (only for ClickHouse, PostgreSQL sources), the conversion is performed by a function in the source database and results may vary for different data sources. For consistent results use ARR_STR.

    Examples

    STR(77) = "77"
    
    STR(1 != 1) = "False"
    
    STR(#2019-01-01#) = "2019-01-01"
    
    STR(ARRAY(1, 2, 3, NULL)) = {1,2,3,NULL}  PostgreSQL
    
    STR(ARRAY(1, 2, 3, NULL)) = [1,2,3,NULL]  ClickHouse
    
    STR(ARRAY('a', 'b', '', NULL)) = {a,b,,NULL}  PostgreSQL
    
    STR(ARRAY('a', 'b', '', NULL)) = ['a','b','',NULL]  ClickHouse
    

    Data source support

    ClickHouse 19.13, Microsoft SQL Server 2017 (14.0), MySQL 5.6, Oracle Database 12c (12.1), PostgreSQL 9.3, YDB.

    Was the article helpful?

    Language / Region
    Yandex project
    © 2023 Intertech Services AG