UPDATE inventory_items SET type = 'Product', subtype = 'Pharmacy', stock = 1, adjustment = 1, purchase = 1, expiry = 1 WHERE id IN(SELECT DISTINCT item_id FROM billing_bill_items WHERE subtype = 'Prescription');