Difference between revisions of "SUBSTR/de"
From SQLZOO
< SUBSTR
| (One intermediate revision by one user not shown) | |||
| Line 2: | Line 2: | ||
<table align='right' border='1'> | <table align='right' border='1'> | ||
<caption>Kompatibilität</caption> | <caption>Kompatibilität</caption> | ||
| − | <tr><th colspan='3'> | + | <tr><th colspan='3'>SUBSTR(s, i, j)</th></tr> |
<tr><td align='center'>'''DBMS'''</td><td align='center'>'''OK'''</td><td align='center'>'''Alternative'''</td></tr> | <tr><td align='center'>'''DBMS'''</td><td align='center'>'''OK'''</td><td align='center'>'''Alternative'''</td></tr> | ||
<tr><td align='left'>Ingres</td><td>Ja</td><td>[[SUBSTRING(ansi)/de | SUBSTRING(s FROM i FOR j)]]</td></tr> | <tr><td align='left'>Ingres</td><td>Ja</td><td>[[SUBSTRING(ansi)/de | SUBSTRING(s FROM i FOR j)]]</td></tr> | ||
| Line 15: | Line 15: | ||
<p></p> | <p></p> | ||
<pre style='width:75ex'> | <pre style='width:75ex'> | ||
| − | SUBSTR(' | + | SUBSTR('Hallo Welt', 2, 3) -> 'llo' |
</pre> | </pre> | ||
Latest revision as of 11:47, 28 October 2012
| SUBSTR(s, i, j) | ||
|---|---|---|
| DBMS | OK | Alternative |
| Ingres | Ja | SUBSTRING(s FROM i FOR j) |
| MySQL | Ja | SUBSTRING(s FROM i FOR j) |
| Oracle | Ja | |
| PostgreSQL | Ja | SUBSTRING(s FROM i FOR j) |
| SQL Server | Nein | SUBSTRING(s,i,j) |
SUBSTR
SUBSTR liefert einen bestimmten Teil einer Zeichenkette. Als Argumente sind die Zeichenkette, der Startpunkt und die Länge des gewünschten Teils anzugeben.
SUBSTR('Hallo Welt', 2, 3) -> 'llo'
In diesem Beispiel wird das 2. bis 5. Zeichen jedes Ländernamens ermittelt.
SELECT name, SUBSTRING(name, 2, 5) FROM bbc
SELECT name, SUBSTR(name, 2, 5) FROM bbc
| Sprache: | English • Deutsch |
|---|