我试图了解在此查询中加入的目的是什么。
SELECT
DISTINCT o.order_id
FROM
`order` o,
`order_product` as op
LEFT JOIN `provider_order_product_status_history` as popsh
on op.order_product_id = popsh.order_product_id
LEFT JOIN `provider_order_product_status_history` as popsh2
ON popsh.order_product_id = popsh2.order_product_id
AND popsh.provider_order_product_status_history_id <
popsh2.provider_order_product_status_history_id
WHERE
o.order_id = op.order_id
AND popsh2.last_updated IS NULL
LIMIT 10
困扰我的是 provider_order_product_status_history 加入了 2 次,我不确定它的目的。非常感谢有人可以提供帮助