I tested the following on MySql and it served the purpose. two things you need to do
1.you have to introduce a unique row identifier - in your case I think id is for that purpose
2.you have to disable the MySql Safe Update in Edit > Preference > Sql Editor if your row id is not primary key
create table test2 (
rowid varchar(10),
id varchar(20),
person_id varchar(20),
item_name varchar(20),
value varchar(20));
insert into test2
(rowid,id, person_id,item_name,value)
values ('1','1','1','first item','first value');
insert into test2
(rowid,id, person_id,item_name,value)
values ('2','1','1','first item','first value');
commit;
SELECT item_name,Count(*) FROM test2 GROUP BY person_id, item_name;
DELETE FROM Test2
WHERE rowid NOT IN (SELECT *
FROM (SELECT MAX(n.rowid)
FROM test2 n
GROUP BY n.person_id, n.item_name) x);
SELECT item_name,Count(*) FROM test2 GROUP BY person_id, item_name;
N.B. If you are a person creating the schema - probably you must not delete data - so before you try this make sure you do it on your play area.