A simple question:
The update query below works perfectly in SQL Server but fails in MySQL.
MySQL err.msg = "Error Code: 1093. You can't specify target table 'Pos' for update in FROM clause".
I can find several workarounds, but looking for best practice.
update Pos set Printed = 1
where InvoiceNo = 3005
and Status = 'N'
and Pos.ItemNo IN
(select Pos.ItemNo from Pos,ItemMaster
where invoiceno = 3005
and status = 'N'
and printed = 0
and catType in ('B','L')
and Pos.itemno = ItemMaster.itemno)