I need help for Error :1062
Hi,
I don't undertand why I recived an error in MySQL Server 5.0 beta version:
ERROR 1062: Duplicate entry 'bellu' for key 1.
You can find below the script to create the table and to populate the table.
After this, if you run the simple "SELECT" query at the end,
is generated the error 1062.
SCRIPT:
------------------------------------------------------------------
CREATE TABLE `tbl_seba` (
`id` tinyint(4) NOT NULL default '0',
`cognome` varchar(50) NOT NULL default '',
`nome` varchar(50) NOT NULL default '',
`indirizzo` varchar(50) NOT NULL default '',
PRIMARY KEY (`id`)
);
INSERT INTO tbl_seba
VALUES(1,'bellu','sebastiano','de gasperi');
INSERT INTO tbl_seba
VALUES(2,'bellu','alessio','da maiano');
INSERT INTO tbl_seba
VALUES(3,'mannu','rina','iglesias');
INSERT INTO tbl_seba
VALUES(4,'mannu','bastianina','iglesias');
INSERT INTO tbl_seba
VALUES(5,'depalmas','elena','de gasperi');
INSERT INTO tbl_seba
VALUES(6,'mannu','maria antonietta','iglesias');
INSERT INTO tbl_seba
VALUES(7,'fancello','maddalena','iglesias');
INSERT INTO tbl_seba
VALUES(8,'bellu','giuseppe','de gasperi');
commit;
select * from tbl_seba
SELECT cognome, count(1)
FROM tbl_seba
#where seba.cognome in ('bellu','mannu')
where cognome = 'bellu' or cognome = 'mannu'
group by 1
------------------------------------------------------------------
Thanks.
All the best.