Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
文字列の一番右側にある文字を返します。
RIGHT( string-expression, integer-expression )
string-expression 一番右側にある文字を返す文字列。
integer-expression 返される文字列の末尾の文字数。
LONG VARCHAR
文字列にマルチバイト文字があり、適切な照合が使用されている場合、返されるバイト数が指定した文字数よりも大きい場合があります。
カラムの値より大きな integer-expression を指定できます。この場合、全体の値が返されます。
入力文字が文字長のセマンティックを使用している場合、可能であれば、戻り値が文字長のセマンティックで記述されます。
SQL/2008 ベンダー拡張。
次の文は、Customers テーブルに含まれる各 Surname 値の最後の 5 文字を返します。
SELECT RIGHT( Surname, 5) FROM Customers;