我在MySQL查询方面遇到了问题。我的表格有4列,看起来像这样:
id_users id_product quantity date
1 2 1 2013
1 2 1 2013
2 2 1 2013
1 3 1 2013
id_users
和id_product
是来自不同表的外键。
我想要的是仅删除一行:
1 2 1 2013
其中有一个出现了两次,因此我希望将其删除。
我尝试过这个查询:
delete from orders where id_users = 1 and id_product = 2
但它将删除它们两个(因为它们是重复的)。有解决这个问题的提示吗?