Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Well, by eye it is 1000 times easier to do through PHP, just sort through the array, select an element from the array, write it to a new array, delete it in the old one and look for a new element, more than the old one, a couple of lines of code.
And in SQL it’s just like trying through UNION and then it’s unlikely (99.99%)
This can be done in SQL using ORDER BY FIELD
https://www.electrictoolbox.com/mysql-order-specif...
I see while only a variant with the temporary table. It is necessary to index the same values, give each an increasing index. And then group by these sub-indices:
remake in
1, 0
1, 1
1, 2
1, 3
2, 0
2, 1
3, 0
3, 1
3, 2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question