SET @contador := 0;
SELECT SUBSTRING_INDEX(
SUBSTRING_INDEX("BOX 01;BOX 02;BOX 03;BOX 04;BOX 05;BOX 06;BOX 07;BOX 08;BOX 09;BOX 10;BOX 11;BOX 12;BOX 13;BOX 14;BOX 15;BOX 16;BOX 17;BOX 18;BOX 19;BOX 20;BOX 21;BOX 22;BOX 23;BOX 24;BOX 25;BOX 26;BOX 27;BOX 28;BOX 29;BOX 30"
, ';', @contador := @contador + 1)
, ';', -1) AS box
, @contador as contagem FROM galpao
With this select
it works kind as a loop for however only it presents 13 record being there 30. In the case in my table the field and type text therefore no matter how many records exist in the precise field that they appear in all column and not only the 13. I have been searching and it seems that the problem is in the native function SUBSTRING_INDEX
q only performs 13 times the search.
detail this has to be in select
- if possible.