sql - Finding duplicate members in a table -


i have come across problem in writing query find duplicate members in table. have tried simplify problem sample table , data.

create table mytable ( s_id varchar2(10), param varchar2(10), value varchar2(10) );   insert mytable (s_id, param, value) values ('1', 'name', 'a'); insert mytable (s_id, param, value) values ('1', 'age', '15'); insert mytable (s_id, param, value) values ('1', 'sex', 'm');  insert mytable (s_id, param, value) values ('2', 'name', 'b'); insert mytable (s_id, param, value) values ('2', 'age', '16'); insert mytable (s_id, param, value) values ('2', 'sex', 'm');  insert mytable (s_id, param, value) values ('3', 'name', 'a'); insert mytable (s_id, param, value) values ('3', 'age', '15'); insert mytable (s_id, param, value) values ('3', 'sex', 'm'); 

here items s_id 1 , 3 same.

here's easy way find duplicate values in 1 field:

select fieldname tablename group fieldname having count(*) > 1 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -