I have a table with two primary index columns. To maintain an edit history, this is first updating a users existing "fourth col" below and setting it to "0", then inserting "1" into this new row:
first col - users primary id/by session
second col - primary id brought from a table join value.
third col - CURRENT_DATE
fourth active col - "0" for inactive, "1" for active.
The update sets a prior user values of fourth col to "o" . No problem.
But when more rows are inserted, everything goes until same values as the prior ones are attempted in the "second col" (primary id). Erroring:
"Duplicate entry '50-2007' for key 1 " or something like this. It won't take same values twice.
Can anyone make a suggestion? Can I make the third col a primary index to make each row unique? - though I'd prefer not to (running queries).