I am new to MySQL and I need your help. I have a table with similar data
--------------------------------------------------- |RobotPosX|RobotPosY|RobotPosDir|RobotShortestPath| --------------------------------------------------- |0.1 | 0.2 | 15 | 1456 | |0.2 | 0.3 | 30 | 1456 | |0.54 | 0.67 | 15 | 1456 | |0.68 | 0.98 | 22 | 1234 | |0.36 | 0.65 | 45 | 1234 | |0.65 | 0.57 | 68 | 1456 | |0.65 | 0.57 | 68 | 2556 | |0.79 | 0.86 | 90 | 1456 | ---------------------------------------------------
As you can see, the values in the RobotShortestPath column are repeated, but they are important. Each number represents a specific task. If the number is repeated sequentially (for example: 1456), this means that the robot performs this task, and when the number is changed (for example: 1234), this means that it switched to another task. And if the previous number (for example: 1456) appears again, this also means that the robot performs a new task (1456) after completing the previous task (1234).
So, when I'm stuck, I can't complete any tasks. I used a few things from my minimum knowledge, such as COUNT, GROUP BY, but nothing works.
No.of tasks 5 are executed here, but whatever I do, I get only 3. As a result.
source share