Is there a way to enforce limited uniqueness on a SQL table?

Move C to a separate table containing only A, B, and C, and make A+B a unique key.