0

I'm not particularly used to using modern computers being an old cobol programmer but I am helping with a sports league which has a small mysql database in wordpress. There are a 3 extra tables added to the sql database which simply displays data in a table of weekly results imported from excel. This all works fine but i wanted to automate the processes using sql and have finally built a bit of a basic crud system to enter results this all works find except the next bit.

I wish to display some of the players breaks. These are stored as follows:

Player_Auto Player ID,  Player_Name   Player_Break 
01          01          Peter Smith   64
02          02          Ian Jones     58
03          02          Ian Jones     78
04          02          Ian Jones     147
05          03          Paul Abbot    87
06          03          Paul Abbot    89
07          04          Fred Boggs    35

I display these in excel in the following way.

"Ian Jones", "147,78,58".
"Paul Abbot", "89,87".
"Peter Smith", "64".
"Fred Bloggs", "35". 

These are sorted by highest break. I am struggling to work out a suitable Sql statement for doing this. I have managed to sort the league tables into ascending order but this is a bit beyond my ability. I am using wpdata tables to display the data so its just the sql Im after unless of course there is an easier method.

Barmar
  • 741,623
  • 53
  • 500
  • 612

0 Answers0