Difference between revisions of "SUBSTRING"
From SQLZOO
| Line 1: | Line 1: | ||
<table align='right' border='1'> | <table align='right' border='1'> | ||
<caption>Compatibility</caption> | <caption>Compatibility</caption> | ||
| − | <tr><th colspan='3'>SUBSTRING(s | + | <tr><th colspan='3'>SUBSTRING(s, i, j)</th></tr> |
<tr><td align='center'>'''Engine'''</td><td align='center'>'''OK'''</td><td align='center'>'''Alternative'''</td></tr> | <tr><td align='center'>'''Engine'''</td><td align='center'>'''OK'''</td><td align='center'>'''Alternative'''</td></tr> | ||
<tr><td align='left'>ingres</td><td>Yes</td><td>[[SUBSTRING(ansi) |SUBSTRING(s FROM i FOR j)]]</td></tr> | <tr><td align='left'>ingres</td><td>Yes</td><td>[[SUBSTRING(ansi) |SUBSTRING(s FROM i FOR j)]]</td></tr> | ||
Revision as of 10:59, 28 October 2012
| SUBSTRING(s, i, j) | ||
|---|---|---|
| Engine | OK | Alternative |
| ingres | Yes | SUBSTRING(s FROM i FOR j) |
| mysql | Yes | SUBSTRING(s FROM i FOR j) |
| oracle | No | SUBSTR(s,i,j) |
| postgres | Yes | SUBSTRING(s FROM i FOR j) |
| sqlserver | Yes | |
SUBSTRING
SUBSTRING allows you to extract part of a string.
SUBSTRING('Hello world', 2, 3) -> 'llo'
SELECT name, SUBSTR(name, 2, 5) FROM bbc
SELECT name, SUBSTRING(name, 2, 5) FROM bbc
| Language: | English • Deutsch |
|---|