MySQLString FunctionsRIGHT
LEFT

RIGHTString Functions

LENGTH

Returns the rightmost n characters of a string.

Syntax

RIGHT(str, n)

Example

Enter values below to update the example in real time.

order_id
order_no
seq
orders
-- 주문번호 뒤 4자리 시퀀스 확인
SELECT order_id, RIGHT(order_no, 4) AS seq
FROM orders;