Sql right characters

This article is tagged with: Sql right characters and mysql

sql right characters

-- For Oracle only
-- syntax
SUBSTR(<main-string>,-<number-of-characters>)
-- example
SUBSTR('Useless stuff',-9) -- OUTPUT: ess stuff
-- practical example
SELECT SUBSTR('Useless stuff',-9)
FROM DUAL;</number-of-characters></main-string>

RIGHT tsql

SELECT RIGHT('SQL Tutorial', 3) AS ExtractString;

This article is tagged with: Sql right characters and mysql