Answer the question
In order to leave comments, you need to log in
Is a pivot table possible in mysql?
Hello!
Straight to the point, no preludes.
Database. It has a note to the workers. The program visualizes the record/schedule/schedule of employees.
With a simple query, I get this result:
Answer the question
In order to leave comments, you need to log in
It will not be possible to automatically obtain the desired table with an arbitrary number of employees. You can either list all workers in the request, as PrAw wrote , or get lists of workers by time and parse them already on the client.
SELECT `time`, GROUP_CONCAT(`worker`)
FROM `table`
GROUP BY `time`
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question