logo

Product documentation

  • Quickstart
    • Getting started
    • Connect to a data source
    • Integrate the data
    • Next steps
  • Concepts
    • Overview of Data Virtualization
    • Technology and Features
    • Virtual tables and views
    • Data Security
  • Data sources
    • Blackbaud FE NXT
    • Exact Online
    • FreshBooks Accounting
    • Microsoft Dynamics GP
    • QuickBooks Desktop
    • QuickBooks Online
    • QuickBooks POS
    • Reckon
    • SAGE Intacct
    • SAGE 50 UK
    • Xero Accounting
    • Alfresco
    • Amazon Marketplace
    • AWS Data Management
    • Basecamp
    • BOX
    • BugZilla
    • DigitalOcean
    • DropBox
    • Email
    • EverNote
    • FTP
    • GMail
    • Google Calendar
    • Google Contacts
    • Google Directory
    • Google Sheets
    • JIRA
    • Kintone
    • Microsoft Azure Data Management
    • Microsoft Exchange
    • Microsoft Office365
    • Microsoft SharePoint
    • SalesForce Chatter
    • ServiceNow
    • Slack
    • SmartSheet
    • Splunk
    • SurveyMonkey
    • Veeva Vault
    • WordPress
    • Zendesk
    • ACT! CRM
    • Act-On
    • Adobe Analytics
    • Google Ad Manager (DoubleClick For Publishers)
    • Google Ads (AdWords)
    • Google Analytics
    • Google Campaign Manager (DoubleClick CM)
    • HighRise CRM
    • HubSpot
    • Magento
    • MailChimp
    • Marketo
    • Microsoft Bing Ads
    • Microsoft Dynamics CRM
    • Microsoft Dynamics CRM
    • Microsoft Dynamics365 Sales
    • Oracle Marketing Cloud (Eloqua)
    • Oracle Sales Cloud
    • SalesForce & Force.com
    • Salesforce Marketing Cloud
    • SendGrid
    • Sugar CRM
    • Suite CRM
    • Twilio
    • Veeva CRM
    • YouTube
    • YouTube Analytics
    • Zoho CRM
    • Actian Matrix
    • Actian Vector
    • Amazon Athena
    • Amazon Aurora
    • Amazon DynamoDb
    • Amazon Redshift
    • Apache Cassandra
    • Apache Drill
    • Apache HBase
    • Apache HIVE
    • Apache Kafka
    • Apache Spark
    • Aster Database
    • ClickHouse
    • Cloudera
    • Couchbase
    • DataStax
    • dBase
    • Denodo
    • ElasticSearch
    • Exasol
    • Firebird
    • Google BigQuery
    • Google Spanner
    • Hortonworks Data Platform
    • HPCC
    • IBM Cloud SQL Query
    • IBM Cloudant
    • IBM DB2
    • MariaDb
    • MarkLogic
    • Microsoft Access
    • Microsoft Azure CosmosDb
    • Microsoft Azure HDInsight
    • Microsoft Azure Table Storage
    • Microsoft SQL Analysis Services
    • Microsoft SQL Server
    • MongoDb
    • MySql
    • Oracle
    • Pervasive SQL (Btrieve)
    • Pivotal GreenPlum
    • PostgreSQL
    • REDIS
    • SAP HANA
    • Snowflake
    • Sybase
    • Teradata
    • Vertica
    • XBase
    • CSV/TSV, PDF, MSG, Text
    • Microsoft Excel
    • Google Drive
    • JSON
    • LDAP Directory Services
    • Microsoft Excel
    • Microsoft Excel Online
    • Microsoft SharePoint Excel Services
    • OData Services
    • REST
    • RSS
    • SFTP
    • XML
    • Acumatica ERP
    • Epicor ERP
    • NetSuite CRM & ERP
    • Odoo ERP
    • SAP Business One
    • SAP ERP
    • Authorize.Net
    • EBay
    • E*Trade
    • FedEx
    • Microsoft Dynamics NAV
    • Microsoft Dynamics365 Business Central
    • Microsoft Dynamics365 Finance and Operations
    • OFX
    • Open Exchange Rates
    • PayPal
    • Quandl
    • SAP Concur
    • SAP Hybris C4C
    • SAS
    • Shopify
    • Square
    • Stripe
    • UPS
    • ADO.Net
    • JDBC
    • ODBC
    • OLE-DB
    • Amazon S3
    • Datarobot
    • Google Search
    • Microsoft Active Directory
    • Microsoft Bing Search
    • Microsoft Project
    • SalesForce Einstein Analytics
    • Wasabi Object Storage
    • Facebook
    • Instagram
    • LinkedIn
    • Twitter
  • User guide
    • Client Connectivity
      • Connecting from Excel
      • Connecting from PowerBI
      • Connecting from Tableau
      • Connecting from SQL Server using Linked Server
      • Connecting from Python
      • Connecting from Rtools and RStudio
    • Connections
      • Create a connection
      • Managing connections
    • Databases overview
      • Create a virtual database
      • Managing the database
    • Schemas
    • Tables
      • Adding tables
      • Managing tables
    • Primary and Foreign Keys
    • Views
      • Adding a view
      • Managing views
    • Materialization
    • Search
    • Tags
    • Management Tasks
    • Indexes
    • Query editor
    • Data masking
    • Overview of Query Retargeting
    • Bulk operations
    • How-to guides
      • How-to connect to text data using Microsoft ODBC
  • Administration Guide
    • Access rights
    • Engine configuration options
    • Monitoring overview
      • Statement history
      • Active statements
      • Client connections
      • Execution plan cache
      • Running jobs
      • Alerts
    • Job and Schedule management
    • Spark connection and management
    • Spark default database migration guide
    • SQL Dialects
    • Tags
    • Users and roles
    • Querona-specific views
      • qua_functions
      • qua_materialized_views
      • qua_provider_tables
      • qua_recent_statements
    • Logging overview
    • Administrative how-to articles
      • How to manually edit metabase deployed on SQLite
      • How to migrate Spark’s default database with metabase on Derby
      • How to manually re-sync HI-LO identifiers in metabase deployed on SQLite
  • SQL Guide
    • Data types
      • Date and time data types
      • Numeric data types
      • Other data types
      • String data types
    • Functions
      • Aggregate
        • APPROX_COUNT_DISTINCT
        • AVG
        • CHECKSUM_AGG
        • COUNT
        • COUNT_BIG
        • GROUPING
        • GROUPING_ID
        • KURTOSIS
        • MAX
        • MIN
        • SKEWNESS
        • STDEV
        • STDEVP
        • STRING_AGG
        • SUM
        • VAR
        • VARP
      • Analytical
        • CUME_DIST
        • FIRST_VALUE
        • LAG
        • LAST_VALUE
        • LEAD
        • PERCENT_RANK
        • PERCENTILE_CONT
        • PERCENTILE_DISC
      • Azure
        • DETECT_FACES
        • USER_TO_ITEM_RECOMMENDATION
      • Date and time
        • CONVERT_TZ
        • DATEADD
        • DATEDIFF
        • DATEFROMPARTS
        • DATENAME
        • DATEPART
        • DATETIME2FROMPARTS
        • DATETIMEFROMPARTS
        • DAY
        • EOMONTH
        • GETDATE
        • GETUTCDATE
        • ISDATE
        • MONTH
        • SMALLDATETIMEFROMPARTS
        • SYSDATETIME
        • SYSUTCDATETIME
        • TIMEFROMPARTS
        • YEAR
      • Expression
        • COALESCE
        • IIF
        • ISNULL
        • NULLIF
      • Math
        • ABS
        • ACOS
        • ASIN
        • ATAN
        • ATN2
        • CEILING
        • COS
        • COT
        • DEGREES
        • EXP
        • FLOOR
        • LOG
        • LOG10
        • PI
        • POWER
        • RADIANS
        • RAND
        • ROUND
        • SIGN
        • SIN
        • SQRT
        • SQUARE
        • TAN
      • Metadata
        • QUA_PARTITION_HINT
      • Pseudonymization
        • QUA_CONNECTIONSHUFFLEKEY
        • QUA_DESHUFFLE
        • QUA_SHUFFLE
      • Ranking
        • DENSE_RANK
        • NTILE
        • RANK
        • ROW_NUMBER
      • String
        • ASCII
        • CHAR
        • CHARINDEX
        • CONCAT
        • FORMAT
        • LEFT
        • LEN
        • LEVENSHTEIN
        • LOWER
        • LTRIM
        • NCHAR
        • PATINDEX
        • QUOTENAME
        • REGEX_EXTRACT
        • REGEX_REPLACE
        • REGEX_SPLIT
        • REPLACE
        • REPLICATE
        • REVERSE
        • RIGHT
        • RTRIM
        • SPACE
        • SPLIT
        • STR
        • STUFF
        • SUBSTRING
        • UNICODE
        • UPPER
      • System
        • @@DATEFIRST
        • @@MAX_PRECISION
        • @@MICROSOFTVERSION
        • @@OPTIONS
        • @@SERVICENAME
        • @@SPID
        • @@TRANCOUNT
        • @@VERSION
        • APP_NAME
        • ASSEMBLYPROPERTY
        • COL_LENGTH
        • COL_NAME
        • COLLATIONNAME
        • COLLATIONPROPERTY
        • COLLATIONPROPERTYFROMID
        • COLUMNPROPERTY
        • CURRENT_USER
        • DATABASE_PRINCIPAL_ID
        • DATABASEPROPERTYEX
        • DB_ID
        • DB_NAME
        • FULLTEXTCATALOGPROPERTY
        • FULLTEXTSERVICEPROPERTY
        • HAS_DBACCESS
        • HAS_PERMS_BY_NAME
        • HASHBYTES
        • INDEXPROPERTY
        • IS_MEMBER
        • IS_ROLEMEMBER
        • IS_SRVROLEMEMBER
        • JSON_PATH
        • LOAD_FILE
        • NEWID
        • OBJECT_ID
        • OBJECT_NAME
        • OBJECT_SCHEMA_NAME
        • OBJECTPROPERTY
        • OBJECTPROPERTYEX
        • PARSENAME
        • QUA_GET_INCREMENTAL_MARKER
        • SCHEMA_ID
        • SCHEMA_NAME
        • SERVERPROPERTY
        • SESSIONPROPERTY
        • SUSER_SNAME
        • SYSTEM_USER
        • TYPE_ID
        • TYPE_NAME
        • TYPEPROPERTY
        • USER_NAME
      • Tabular
        • fn_builtin_permissions
        • fn_helpcollations
    • Language Elements
      • Expressions
      • Identifiers
      • Keywords
      • Literals
      • Operators
    • Queries
      • SELECT
        • SELECT statement
        • SELECT Clause
        • SELECT Examples
        • SELECT - GROUP BY
        • SELECT - HAVING
        • SELECT - ORDER BY
        • SELECT - OVER
      • FROM
      • WHERE
      • Hints
      • OPTION clause
      • Predicates
      • TOP
    • Statements
      • DDL
        • CREATE DATABASE
        • CREATE INDEX
        • CREATE ROLE
        • CREATE SCHEMA
        • DROP DATABASE
        • DROP INDEX
        • DROP SCHEMA
      • SET Statements
        • SET ANSI_NULLS
        • SET ANSI_PADDING
        • SET ARITHABORT
        • SET ARITHIGNORE
        • SET CONCAT_NULL_YIELDS_NULL
        • SET CURSOR_CLOSE_ON_COMMIT
        • SET DATEFIRST
        • SET DATEFORMAT
        • SET DEADLOCK_PRIORITY
        • SET FMTONLY
        • SET IMPLICIT_TRANSACTIONS
        • SET LANGUAGE
        • SET LOCK_TIMEOUT
        • SET NOCOUNT
        • SET NOEXEC
        • SET NUMERIC_ROUNDABORT
        • SET PARSEONLY
        • SET QUERY_GOVERNOR_COST_LIMIT
        • SET QUOTED_IDENTIFIER
        • SET ROWCOUNT
        • SET SHOWPLAN_ALL
        • SET SHOWPLAN_TEXT
        • SET SHOWPLAN_XML
        • SET STATISTICS IO
        • SET STATISTICS PROFILE
        • SET STATISTICS TIME
        • SET STATISTICS XML
        • SET TEXTSIZE
        • SET TRANSACTION ISOLATION LEVEL
    • Stored procedures
      • qua_flush_plan_cache
      • qua_run_garbage_collection
      • qua_set_default_federator
      • qua_create_view_copy
      • qua_evict_spark_inmem_cached_table
      • qua_full_load_cached_view_copy
      • qua_full_load_view_copy
      • qua_incremental_insert
      • qua_incremental_load_cached_view_copy
      • qua_invalidate_spark_cached_table
      • qua_populate_cached_table
      • qua_refresh_view
      • qua_set_incremental_marker
      • qua_set_incremental_marker_column
      • qua_set_reload_mode
      • qua_set_view_cache_mode
      • qua_set_view_copy_status
      • qua_switch_view_copy
      • qua_trim_view_copy
      • qua_get_oauth_access_token_d365
      • qua_get_oauth_authorization_url_d365
      • sp_addlinkedserver
      • sp_addlinkedsrvlogin
      • sp_dropserver
      • sp_linkedservers
      • sp_testlinkedserver
      • sp_updatelinkedserver
      • qua_help_jobs
      • qua_set_logging_level
      • sp_add_job
      • sp_add_jobstep
      • sp_add_schedule
      • sp_attach_schedule
      • sp_delete_job
      • sp_delete_jobstep
      • sp_delete_schedule
      • sp_detach_schedule
      • sp_help_job
      • sp_help_jobstep
      • sp_start_job
      • sp_stop_job
      • sp_update_job
      • sp_update_jobstep
      • sp_update_schedule
      • qua_analyze_table
      • qua_execute_provider_sql_on_connection
      • qua_update_object_statistics
      • qua_update_row_count_object_statistics
      • qua_get_partitioning_schema
      • qua_set_partitioning_schema
      • sp_describe_first_result_set
      • sp_generate_views
      • sp_import_metadata
      • qua_spark_force_become_active
      • qua_spark_force_become_standby
      • qua_spark_instance_kill
      • qua_spark_instance_start
      • qua_spark_instance_stop
      • qua_spark_release
      • qua_spark_stop_driver
    • Views
      • sys.configurations
      • sys.time_zone_info
      • syscategories
      • sysjobhistory
      • sysjobs
      • sysschedules
  • Installation guide
    • Components
    • Requirements and compatibility
    • Installation prerequisites
    • Installation procedure
    • Installation troubleshooting
    • Configuration Settings and Security
    • How to upgrade Querona
    • Installation of SQL Server Engine
    • Installing Querona driver on Cloudera
  • Glossary
Contents
  • Syntax
  • Arguments
  • Return types
  • Examples
  • See Also

RIGHT

Contents

  • Syntax
  • Arguments
  • Return types
  • Examples
  • See Also

RIGHT#

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

Syntax#

RIGHT ( character_expression , integer_expression )

Arguments#

character_expression

Is an expression of character or binary data. character_expression can be a constant, variable, or column. character_expression can be of any data type, except text or ntext, that can be implicitly converted to varchar or nvarchar. Otherwise, use the CAST function to explicitly convert character_expression.

index

Is a positive integer that specifies how many characters of the character_expression will be returned. If index is negative, an error is returned. If index is type bigint and contains a large value, character_expression must be of a large data type such as varchar(max).

Return types#

varchar or nvarchar

Examples#

SELECT RIGHT('0000 0',20);

See Also#

  • Functions

previous

REVERSE

next

RTRIM

© Copyright 2015-2022, YouNeedIT.