MSSQLString FunctionsRIGHT
LEFT

RIGHTString Functions

LEN

Returns the rightmost n characters.

Syntax

RIGHT(str, n)

Example

Enter values below to update the example in real time.

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