grouping and switching the columns and rows
问题 I don't know if this would officially be called a pivot, but the result that I would like is this: +------+---------+------+ | Alex | Charley | Liza | +------+---------+------+ | 213 | 345 | 1 | | 23 | 111 | 5 | | 42 | 52 | 2 | | 323 | | 5 | | 23 | | 1 | | 324 | | 5 | +------+---------+------+ my input data is in this form: +-----+---------+ | Apt | Name | +-----+---------+ | 213 | Alex | | 23 | Alex | | 42 | Alex | | 323 | Alex | | 23 | Alex | | 324 | Alex | | 345 | Charley | | 111 | Charley