reverse

Description

Returns the specified string with characters listed in reverse order.

Syntax

reverse(expression | uchar_expr)

Parameters

expression

is a character or binary-type column name, variable, or constant expression of char, varchar, nchar, nvarchar, binary, or varbinary type.

uchar_expr

is a character or binary-type column name, variable, or constant expression of unichar or univarchar type.

Examples

Example 1

select reverse("abcd")
---- 
dcba

Example 2

select reverse(0x12345000)
----------
0x00503412

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute reverse.

See also

Functions lower, upper