临摹微笑
您可以使用WHILE循环在MySQL中实现:SET @myArrayOfValue = '2,5,2,23,6,';WHILE (LOCATE(',', @myArrayOfValue) > 0)DO SET @value = ELT(1, @myArrayOfValue); SET @myArrayOfValue= SUBSTRING(@myArrayOfValue, LOCATE(',',@myArrayOfValue) + 1); INSERT INTO `EXEMPLE` VALUES(@value, 'hello');END WHILE;编辑:或者,您可以使用UNION ALL:INSERT INTO `EXEMPLE`( `value`, `message`)( SELECT 2 AS `value`, 'hello' AS `message` UNION ALL SELECT 5 AS `value`, 'hello' AS `message` UNION ALL SELECT 2 AS `value`, 'hello' AS `message` UNION ALL ...);