make_set(bits,str1,str2,...) 是 MySQL 的一个 字符串函数。此方法返回给定集合位置的值。
语法
select make_set(bits, str1, str2,...);
示例 1
Select make_set(1, 'apple','mango','grapes');
输出:
mysql> Select make_set(1, 'apple','mango','grapes');
+---------------------------------------+
| make_set(1, 'apple','mango','grapes') |
+---------------------------------------+
| apple |
+---------------------------------------+
1 row in set (0.00 sec)
示例 2
Select make_set(1|3, 'apple','mango','grapes');
输出:
mysql> Select make_set(1|3, 'apple','mango','grapes');
+-----------------------------------------+
| make_set(1|3, 'apple','mango','grapes') |
+-----------------------------------------+
| apple,mango |
+-----------------------------------------+
1 row in set (0.01 sec)
示例 3
Select make_set(1|4, 'apple','mango','grapes');
输出:
mysql> Select make_set(1|4, 'apple','mango','grapes');
+-----------------------------------------+
| make_set(1|4, 'apple','mango','grapes') |
+-----------------------------------------+
| apple,grapes |
+-----------------------------------------+
1 row in set (0.00 sec)
示例 4
Select make_set(4, 'apple','mango','grapes');
输出:
mysql> Select make_set(4, 'apple','mango','grapes');
+---------------------------------------+
| make_set(4, 'apple','mango','grapes') |
+---------------------------------------+
| grapes |
+---------------------------------------+
1 row in set (0.00 sec)