Dia*_*nto 6 database postgresql null
我在postgres上有这样的行:
name | address | college
john | rome |
john | rome |
max | tokyo |
Run Code Online (Sandbox Code Playgroud)
我创建一个这样的表:
create test (
name varchar(10),
address varchar(20),
college varchar(20),
constraint test_uq unique (name,address,college);
Run Code Online (Sandbox Code Playgroud)
如何使空值变为唯一,因此输出可以是这样的:
name | address | college
john | rome |
max | tokyo |
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
452 次 |
| 最近记录: |