Keep the newest instead of the oldest on campacting stock entries

This commit is contained in:
Bernd Bestel
2021-07-12 18:58:49 +02:00
parent cf8604e984
commit 4aee175105

View File

@@ -9,7 +9,7 @@ SELECT
product_id,
SUM(amount) AS total_amount,
MIN(stock_id) AS stock_id_to_keep,
MIN(id) AS id_to_keep,
MAX(id) AS id_to_keep,
GROUP_CONCAT(id) AS id_group,
GROUP_CONCAT(stock_id) AS stock_id_group,
id -- Dummy