I don't know if MySQL (or any DB for that matter) can do this, but I'm assuming it can be done.
I have a table, with multiple fields. One of these fields tracks the total number of available 'items', and another holds how many are currently in use.
Is it possible to validate incoming data in an UPDATE statement, such that the UPDATE will fail if the number of items in use would become greater than the total available? IE can I add numerical limits to a field based on the contents of another field?
BEFORE UPDATEtrigger to validate the value.