I'd like to add a constraint to a column that prevents a new row insertion if the value to be added to that column doesn't exist already. I've been at it for a while, this isn't my current code but I wanted it to be clear what I'm trying to accomplish.
ALTER TABLE emps
ADD CONSTRAINT department_id_ck
WHERE department_id = 10 | 20 | 50 | 60 | 80 | 90 | 110;
Any help is greatly appreciated.
After a little bit of playing this is the statement that I was looking for...