我有一个像这些行上的Postgres:空值不是唯一的
name | address | college
john | rome |
john | rome |
max | tokyo |
我创建一个表是这样的:
create test (
name varchar(10),
address varchar(20),
college varchar(20),
constraint test_uq unique (name,address,college);
我怎样才能让空值成为唯一的,所以输出可以是这样的:
name | address | college
john | rome |
max | tokyo |
有关MySQL和非唯一空值的相关问题:http://stackoverflow.com/query estions/4081783/unique-key-with-nulls – osa