So here\'s what I want to do on my MySQL database.
I would like to do:
SELECT * FROM itemsOrdered WHERE purchaseOrder_ID = \'@purchaseOr
if not exists(select top 1 fromFROM itemsOrdered WHERE purchaseOrder_ID = '@purchaseOrdered_ID' AND status = 'PENDING' ) Begin UPDATE purchaseOrder SET purchaseOrder_status = 'COMPLETED' WHERE purchaseOrder_ID = '@purchaseOrder_ID End