【发布时间】:2019-07-12 19:22:26
【问题描述】:
表格包含产品的图像。每行指向产品图片的 URL。许多产品都有多张图片。
url > Image url
product_id > Product's ID
某些产品有重复的图像。我只需要从重复项中保留一个,并删除该产品的其他重复 URL。
我无法对 URL 进行分组并删除重复项,因为可能有另一行具有相同的 URL 并具有不同的 product_id。
TABLE
-
id | product_id | url | is_primary
【问题讨论】:
-
您能否展示示例数据(几行)和预期结果?我无法理解您的要求
I want to remove duplicates with the same URL ... but I cannot remove duplicates because there might be another row that has the same URL and have different product_id- 您的意思是“仅删除相同产品 ID 的重复项”吗? -
图片上传为例
-
@sirdavalos 。 . .您更新的数据没有重复的产品。
标签: sql postgresql duplicates sql-delete