In this case, how can I use insert ignore
to prevent duplicate rows being inserted?
It all on the userId and elmCol
So:
userId | elmCol
----------------
1 | 1 //Allow
1 | 2 //Allow
1 | 3 //Allow
1 | 1 //Not allowed if inserted again. I've put it in here just for example)
2 | 1 //Allow
2 | 2 //Allow
2 | 3 //Allow
2 | 1 //Not allowed if inserted again. I've put it in here just for example)
I'm using MySql and MyIsam type tables. Can I do something like this and use insert ignore
?
I tried creating primary keys, but cannot use them on all columns.