I have a SQL table_1
with the following data:
There are multiple entries with and the same MSISDN gets repeated, but with different servicCodes
in each line.
I would like to copy the info into a new table_2
, but with only one entry per MSISDN and some extra columns with the services assigned to it. Can this be done with a single SQL query, or is it be best to use PHP to do a distinct query and loop through the results?
Thanks.