| Firebird Documentation Index → Firebird 2.5 Language Ref. Update → Internal functions → REVERSE() |
![]() |
Find a more recent version at Firebird 5.0 Language Reference: REVERSE()
Available in: DSQL, PSQL
Added in: 2.1
Description: Returns a string backwards.
Result type: VARCHAR
Syntax:
REVERSE (str)
Examples:
reverse ('spoonful') -- returns 'lufnoops'
reverse ('Was it a cat I saw?') -- returns '?was I tac a ti saW'
This function comes in very handy 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');| Firebird Documentation Index → Firebird 2.5 Language Ref. Update → Internal functions → REVERSE() |