Answer the question
In order to leave comments, you need to log in
How to group correctly the data in the table while not losing their values?
Hello everyone!
There is a table (abbreviated):
id // stime // coach_id
1 // 10:00 // 34
2 // 20:00 // 35
3 // 20:00 // 22
4 // 10:30 // 33
5 // 10:00 // 35
6 // 20:00 // 33
Is it possible to somehow group the SQL data with a query to get something like
stime // id // coach_id
10:00 // 1.5 // 34 ,35
20:00 // 2,3,6 // 35,22,33
That is, the principle is to group data by stime (so that there are no repetitions) while getting data from all grouped columns.
We need this for a sign with a schedule.
It turns out that the user enters the time of the lesson and other data in different columns, but the time can be repeated in the table, but you need to remove the duplicate values, and for the same time value there can be several rows in the table containing data about the lesson, name, coach, etc. . With the usual grouping by class time, it is not possible to save them, they just remain 1 value from the table.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question