In MySQL, is it possible to have a UNIQUE constraint on a line?

advertisements

Appears that MySQL's UNIQUE constraint is on a columns by column basis, I'm looking for a way to make sure the row are UNIQUE on a row by row basis; guessing the answer is to create a hash from by concatenating the columns per row I want to be UNIQUE then but a UNIQUE on the column storing the hash for that row. Also, the rows themselves unless I create a control will always be UNIQUE, since the ID for the row is a SURROGATE_KEY; meaning it's an integer sequential growing by +1 of the ID of the last row's integer.


You can create a multiple-column UNIQUE index.