elt()函数是MySQL的一个字符串函数。此方法是返回字符串列表中的第 N 个元素。
语法
select elt(N,str1,str2,str3,...)
示例 1
select elt(3,'this','is','yxjc123','website')
输出:
mysql> select elt(3,'this','is','yxjc123','website')
-> ;
+----------------------------------------+
| elt(3,'this','is','yxjc123','website') |
+----------------------------------------+
| yxjc123 |
+----------------------------------------+
1 row in set (0.00 sec)
示例 2
select elt(4,'my','sql','string','function')
输出:
mysql> select elt(4,'my','sql','string','function')
-> ;
+---------------------------------------+
| elt(4,'my','sql','string','function') |
+---------------------------------------+
| function |
+---------------------------------------+
1 row in set (0.00 sec)