我的表地籍:
cod_bolsa VARCHAR(7) PRIMARY KEY
nome VARCHAR(70) NOT NULL
endereco VARCHAR(100) NOT NULL
email VARCHAR(50) NOT NULL
telefone VARCHAR(13) NOT NULL
celular VARCHAR(14) NOT NULL
cpf VARCHAR(14) UNIQUE
cnpj VARCHAR(18) UNIQUE
rg VARCHAR(12) UNIQUE
datanasc VARCHAR(12) NOT NULL
查询:
INSERT INTO cadastro VALUES(
'000036',
'JULIO CESAR',
'AV. FRANZ VOEGELI, 300 - VILA YARA, SÃO PAULO/SP',
'julio.c@mail.com',
'(11)2345-6789',
'(11)99876-5432',
'987.654.321.00',
'',
'98.765.432-1',
'1972-5-12'
);
INSERT INTO cadastro VALUES(
'000125',
'JOAO MARIA',
'AV. FRANZ VOEGELI, 300 - VILA YARA, SÃO PAULO/SP',
'joao.m@mail.com',
'(11)2345-6789',
'(11)91676-1334',
'012.234.567-89',
'',
'01.234.345-8',
'1991-1-20'
);
MySQL显然说
ERROR 1062 (23000): Duplicate entry '' for key 'cnpj'
如何避免?