I am creating a table ,in the table two column is unique, I mean columnA and columnB do not have same value:
such as :
Table X
A B
1 2(RIGHT,unique)
2 2(RIGHT, unique)
1 3(RIGHT, not unique)
2 3(RIGHT, not unique)
1 2 (WRONG, not unique)
How to create such a table?
many thanks!
create table X
(
[ID] INTEGER PRIMARY KEY AUTOINCREASE NOT NULL,\
[A] INTEGER,
[B] INTEGER);
Create a unique key column:
The last line will fail because the combination a = 1 and b = 2 already exists in the table.