PostgreSQLString FunctionsRIGHT
LEFT

RIGHTString Functions

LENGTH

Returns the rightmost n characters.

Syntax

RIGHT(str, n)

Example

Enter values below to update the example in real time.

account_no
masked_account
bank_accounts
SELECT RIGHT(account_no, 4) AS masked_account
FROM bank_accounts;