I have a table of 2 columns, user_id and connection_type. Both the fields are not unique. One single user id can appear many times and one single connection type can appear many times. How will I group all the connection types to one single user id?
Table I have:
schema:
user_id -- INT
connection_type -- STRING
user_id connection_type
101 4g
102 3g
101 4g
101 2g
102 2g
101 4g
102 4g
101 4g
102 4g
101 4g
Table I need from the above:
user_id connection_type
101 ['4g','4g','2g','4g','4g','4g']
102 ['3g','2g','4g','4g']
102 ['4g','2g','4g','3g'](the elements in a different order ) would be equally valid. (before someone says this is not an answer to the question that was asked, that's why i posted this as a comment and not an answer)