I’d like to know how to make paired columns unique key?
I’m working on MySQL workbench, and right now I’ve set two columns (follow,following) to be UQ, I’m assuming this is Unique Key?
So when I tried to insert rows, I tried to insert
follow following
3 5
3 6
But follow is unique key. But i’d like to only do unique key for a pair only, not individual numbers.
Thanks
If i’m not mistaken you have only set a unique key for each column. Maybe you want compound column to be
UNIQUE, tryif you run the
ALTERstatement, the example data above is valid but if you try to insert another pair of3, 5, it is guaranteed to fail.