ELT
Descriptionβ
Returns a string at the specified index. Special cases:
- If there is no string at the specified index, NULL is returned.
Syntaxβ
ELT ( <pos> , <str> [ , <str> ] )
Parametersβ
Parameter | Description |
---|---|
<pos> | Specified index value |
<str> | String to be indexed |
Return valueβ
Parameter <str>
String to be indexed. Special cases:
- If there is no string at the specified index, NULL is returned.
Exampleβ
SELECT ELT(1, 'aaa', 'bbb'),ELT(2, 'aaa', 'bbb'), ELT(0, 'aaa', 'bbb'),ELT(2, 'aaa', 'bbb')
+----------------------+----------------------+----------------------+----------------------+
| elt(1, 'aaa', 'bbb') | elt(2, 'aaa', 'bbb') | elt(0, 'aaa', 'bbb') | elt(2, 'aaa', 'bbb') |
+----------------------+----------------------+----------------------+----------------------+
| aaa | bbb | NULL | bbb |
+----------------------+----------------------+----------------------+----------------------+