Important
The SingleStore 9.1 release candidate (RC) is available now. It will be promoted to general availability (GA) soon and at that time it will be renamed to SingleStore 10.
In the interim, SingleStore 9.1 RC can be used to preview, evaluate, and provide feedback on the new and upcoming features in SingleStore 10, while SingleStore 9.0 is recommended for production workloads.
ELT
On this page
The ELT() function returns the Nth value in its list of arguments.
Syntax
ELT (pos, val, [val, [val...]])
Arguments
-
pos: one-indexed argument position
-
val: any number of values.
Remarks
-
The function returns
NULLifposis less than 1 or greater than the number of values specified as arguments.
Examples
SELECT ELT(2, 'foo', 'bar', 'baz') AS Result;
+-----------------------------+
| Result |
+-----------------------------+
| bar |
+-----------------------------+SELECT ELT(0, 'housewares', 'textiles', 'appliances', 'lamps') AS Product_Type;
+------------------------------+
| Product_Type |
+------------------------------+
| NULL |
+------------------------------+
1 row in set (295 ms)SELECT ELT(5, 'name', 'code', 'location') AS Company_Details;
+------------------------------+
| Company_Details |
+------------------------------+
| NULL |
+------------------------------+
1 row in set (320 ms)Last modified: