Difference between revisions of "RIGHT"
Jump to navigation
Jump to search
Line 40: | Line 40: | ||
<li>[[POSITION |POSITION function]]</li> | <li>[[POSITION |POSITION function]]</li> | ||
</ul> | </ul> | ||
{{Languages}} |
Latest revision as of 20:41, 22 October 2012
RIGHT(s,i) | ||
---|---|---|
Engine | OK | Alternative |
ingres | Yes | |
mysql | Yes | |
oracle | No | SUBSTR(s, -i) |
postgres | No | SUBSTRING(s , 1+LENGTH(s)-i , i) |
sqlserver | Yes |
RIGHT
RIGHT(s,n) allows you to extract n characters from the end of the string s.
RIGHT('Hello world', 4) -> 'orld'
SELECT name,
SUBSTRING(name, 1+LENGTH(name)-3, 3)
FROM bbc
SELECT name,
SUBSTR(name, -3)
FROM bbc
SELECT name,
RIGHT(name, 3)
FROM bbc
See also
Language: | English • Deutsch |
---|