Watch the 7.3 Webinar On-Demand
This new release brings updates to Universal Storage, query
optimization, and usability that you won’t want to miss.
Returns the Nth value in its list of arguments.
ELT (pos, val, [val, [val...]])
NULL
if pos
is less than 1 or greater than the number of values specified as arguments.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)