草庐IT

productListing

全部标签

php - 查找 mySQL 重复项,然后合并数据

我有一个不到200万行的mySQL数据库。数据库是非交互式的,因此效率不是关键。我的(简化)结构是:`id`int(11)NOTNULLauto_increment`category`varchar(64)NOTNULL`productListing`varchar(256)NOTNULL现在我要解决的问题是,我想在productListing字段上找到重复项,将category字段上的数据合并为一个结果——删除重复项。所以给定以下数据:+----+-----------+---------------------------+|id|category|productListing|+