bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL Server REVERSE() Function

Concept visual

SQL Server REVERSE() Function

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Example

Reverse a string:

SELECT REVERSE('SQL Tutorial');

Definition and Usage

The REVERSE() function reverses a string and returns the result.

Syntax

Reverse(

string )

Parameter Values

Parameter

Description string

Required. The string to reverse

Technical Details

Works in:

SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse

More Examples

Example

Reverse the text in CustomerName:

SELECT REVERSE(CustomerName)

FROM Customers;

Previous

❮ SQL Server Functions

Next

Previous

SQL Server REPLICATE() Function

Next

SQL Server RIGHT() Function