标签: php mysql sql
如何将结果按一列分组,但循环显示另一列的结果?
示例我有一个名为albums_sold的数据库表由:
albums_sold
id | buyer_email | albums_id
我想做类似的事情:
"SELECT buyer_email, albums_id FROM albums_sold GROUP BY buyer_email"
我希望按buyer_email对结果进行分组,但要获取循环中每个albums_id的{{1}}的所有值。
buyer_email
albums_id