Here I rewrite a question left suspended in the month of July.
I added the field order_item_id on table #_sellacious_transactions and I updated the historical row with the query:
UPDATE `#_sellacious_transactions` AS tr
LEFT JOIN `#_sellacious_order_items` AS oi ON oi.item_uid=REPLACE(SUBSTRING_INDEX(tr.`notes`, 'Articolo: ', -1), '.', '') AND oi.order_id=tr.order_id
SET tr.order_item_id=oi.id
Please, could you fill in this crucial field every time you create a record in the table? Otherwise it becomes very difficult to make analyzes.