FirebirdSQL logo

REVERSE()

Reverses a string

Result type

VARCHAR

Syntax
REVERSE (string)
Table 1. REVERSE Function Parameter
Parameter Description

string

An expression of a string type

REVERSE Examples

reverse ('spoonful')            -- returns 'lufnoops'
reverse ('Was it a cat I saw?') -- returns '?was I tac a ti saW'
Tip

This function is useful if you want to group, search or order on string endings, e.g. when dealing with domain names or email addresses:

create index ix_people_email on people
  computed by (reverse(email));

select * from people
  where reverse(email) starting with reverse('.br');