I have a table where each row contains a temperature and the weather condition such as:
temp condition
17 cloudy
25 sunny
22 cloudy
41 sunny
12 showers
38 sunny
I am restricted for storage space so I wanted to cut down the size of this table. How can I merge the same weather conditions into one row where the temperature column has the different temperatures with a seperator such as "|"?
Once merged the table would look like:
temp condition
17|22 cloudy
25|41|38 sunny
12 showers
I have changed the data type of the temp column to varchar to allow it to store the new format, but not sure how I can merge the rows now.
I want to overwrite this table with the new format as opposed to just combining it on select query. This will help to lower the file size and make it faster to run queries. If this cannot be done directly on mysql (phpmyadmin) then I would prefer to do this via a PHP script.