Logo
latest

Contents:

  • First steps with SQream DB
  • Guides
    • Inserting data
      • Insert from CSV
      • Insert from Parquet
      • Insert from ORC
      • Migrating from Oracle
    • Client drivers for v2020.3.2.1
      • Python (pysqream)
        • pysqream API reference
      • C++ Driver
      • JDBC
      • ODBC
        • Install and configure ODBC on Windows
        • Install and configure ODBC on Linux
      • Node.JS
    • Third party tools
      • Connecting to SQL Workbench
      • Connecting to Tableau
      • Connecting with R
      • Connecting with PHP
      • Connecting to SAS Viya
    • Operations
      • Optimization and best practices
      • Monitoring query performance
      • Logging
      • Configuration
      • Troubleshooting
      • Gathering information for SQream support
      • Creating or cloning a storage cluster
      • SQream Acceleration Studio
      • Using the statement editor (deprecated)
      • Hardware Guide
      • Security
      • Setting up SQream DB
        • Before you begin
        • Start a local SQream DB cluster with Docker
        • Recommended post-installation configuration
    • Features guides
      • Access control
      • Concurrency and locks
      • Concurrency and scaling in SQream DB
      • Metadata system
      • Chunks and extents
      • Compression
      • Data clustering
      • Deleting data
      • Time based data management
      • Foreign Tables
      • Working with external data
        • S3
        • HDFS
      • Transactions
      • Workload manager
      • Python UDF (user-defined functions)
      • Saved queries
      • Seeing system objects as DDL
    • Architecture
      • Internals and architecture
      • Filesystem and usage
  • Reference
    • Data Types
    • SQL statements and syntax
      • SQL syntax features
        • Keywords and Identifiers
        • Literals
        • Scalar expressions
        • Joins
        • Common table expressions (CTEs)
        • Window functions
        • Subqueries
        • Null handling
      • SQL statements
        • ADD COLUMN
        • ALTER DEFAULT SCHEMA
        • ALTER TABLE
        • CLUSTER BY
        • CREATE DATABASE
        • CREATE EXTERNAL TABLE
        • CREATE FOREIGN TABLE
        • CREATE FUNCTION
        • CREATE SCHEMA
        • CREATE TABLE
        • CREATE TABLE AS
        • CREATE VIEW
        • DROP CLUSTERING KEY
        • DROP COLUMN
        • DROP DATABASE
        • DROP FUNCTION
        • DROP SCHEMA
        • DROP TABLE
        • DROP VIEW
        • RENAME COLUMN
        • RENAME TABLE
        • COPY FROM
        • COPY TO
        • DELETE
        • INSERT
        • SELECT
        • TRUNCATE
        • TRUNCATE_IF_EXISTS
        • VALUES
        • DROP_SAVED_QUERY
        • DUMP_DATABASE_DDL
        • EXECUTE_SAVED_QUERY
        • GET_DDL
        • GET_FUNCTION_DDL
        • GET_VIEW_DDL
        • LIST_SAVED_QUERIES
        • RECOMPILE_SAVED_QUERY
        • RECOMPILE_VIEW
        • SAVE_QUERY
        • SHOW_SAVED_QUERY
        • EXPLAIN
        • SHOW_CONNECTIONS
        • SHOW_LOCKS
        • SHOW_NODE_INFO
        • SHOW_SERVER_STATUS
        • STOP_STATEMENT
        • SHOW_SUBSCRIBED_INSTANCES
        • SUBSCRIBE_SERVICE
        • UNSUBSCRIBE_SERVICE
        • ALTER DEFAULT PERMISSIONS
        • ALTER ROLE
        • CREATE ROLE
        • DROP ROLE
        • GET_STATEMENT_PERMISSIONS
        • GRANT
        • RENAME ROLE
        • REVOKE
      • SQL functions
        • Scalar functions
          • & (bitwise AND)
          • ~ (bitwise NOT)
          • | (bitwise OR)
          • << (bitwise shift left)
          • >> (bitwise shift right)
          • XOR (bitwise XOR)
          • BETWEEN
          • CASE
          • COALESCE
          • IN
          • IS_ASCII
          • IS NULL
          • ISNULL
          • FROM_UNIXTS, FROM_UNIXTSMS
          • TO_HEX
          • TO_UNIXTS, TO_UNIXTSMS
          • CURDATE
          • CURRENT_DATE
          • CURRENT_TIMESTAMP
          • DATEADD
          • DATEDIFF
          • DATEPART
          • EOMONTH
          • EXTRACT
          • GETDATE
          • SYSDATE
          • TRUNC
          • ABS
          • ACOS
          • Arithmetic operators
          • ASIN
          • ATAN
          • ATN2
          • CEILING / CEIL
          • COS
          • COT
          • CRC64
          • DEGREES
          • EXP
          • FLOOR
          • LOG
          • LOG10
          • MOD, %
          • PI
          • POWER
          • RADIANS
          • ROUND
          • SIN
          • SQRT
          • SQUARE
          • TAN
          • TRUNC
          • CHAR_LENGTH
          • CHARINDEX
          • || (Concatenate)
          • ISPREFIXOF
          • LEFT
          • LEN
          • LIKE
          • LOWER
          • LTRIM
          • OCTET_LENGTH
          • PATINDEX
          • REGEXP_COUNT
          • REGEXP_INSTR
          • REGEXP_SUBSTR
          • REPEAT
          • REPLACE
          • REVERSE
          • RIGHT
          • RLIKE
          • RTRIM
          • SUBSTRING
          • TRIM
          • UPPER
        • Aggregate functions
          • AVG
          • CORR
          • COUNT
          • COVAR_POP
          • COVAR_SAMP
          • MAX
          • MIN
          • STDDEV_POP
          • STDDEV_SAMP
          • SUM
          • VAR_POP
          • VAR_SAMP
        • Window functions
          • LAG
          • LEAD
          • ROW_NUMBER
          • RANK
        • LAG
        • LEAD
        • RANK
        • ROW_NUMBER
        • SHOW_VERSION
    • Catalog reference
    • Command line programs
      • metadata_server
      • sqreamd
      • sqream-console
      • sqream-installer
      • server_picker
      • SqreamStorage
      • sqream sql
      • upgrade_storage
    • SQL Feature Checklist
  • Releases
    • What’s new in 2020.3.2.1
    • What’s new in 2020.3.1
    • What’s new in 2020.3
    • What’s new in 2020.2
    • What’s new in 2020.1
    • What’s new in 2019.2.1
  • Glossary
SQream DB
  • Docs »
  • Reference »
  • SQL statements and syntax »
  • SQL functions »
  • Scalar functions »
  • RIGHT

RIGHT¶

Returns the right part of a character string with the specified number of characters.

See also LEFT.

Syntax¶

RIGHT( expr , character_count )

Arguments¶

Parameter Description
expr String expression
character_count A positive integer that specifies how many characters to return.

Returns¶

Returns the same type as the argument supplied.

Notes¶

  • This function works on TEXT strings only.
  • If the value is NULL, the result is NULL.

Examples¶

For these examples, consider the following table and contents:

CREATE TABLE jabberwocky(line TEXT(50));

INSERT INTO jabberwocky VALUES
   ('''Twas brillig, and the slithy toves '), ('      Did gyre and gimble in the wabe: ')
   ,('All mimsy were the borogoves, '), ('      And the mome raths outgrabe. ')
   ,('"Beware the Jabberwock, my son! '), ('      The jaws that bite, the claws that catch! ')
   ,('Beware the Jubjub bird, and shun '), ('      The frumious Bandersnatch!" ');

Using RIGHT¶

t=> SELECT LEFT(line, 10), RIGHT(line, 10) FROM jabberwocky;
left       | right
-----------+-----------
'Twas bril | thy toves
      Did  | the wabe:
All mimsy  | orogoves,
      And  | outgrabe.
"Beware th | , my son!
      The  | at catch!
Beware the |  and shun
      The  | rsnatch!"
Next Previous

© Copyright 2021 SQream Revision 4f3dd842.

SQream DB v: latest
Versions
latest
v2020.3.2.1
v2020.3.2
v2020.3.1
v2020-3
v2020-2
v2020-1
Downloads
pdf
html