ms access - sql query return the rows without common attributes -
i'm new sql ans ms-access. so, have table tab1, columns id, decscription, number want make query returns id of rows without common description , number. desirable output this
i have tried
select id tab1 group id, description, number having count(*)=1;
but returns logical error.
if want return rows unique, can do:
select * tab1 not exists (select 1 tab1 t tab1.description = t.description , tab1.number = t.number , tab1.id <> t.id );
you can using aggregation. id
:
select max(id) tab1 group description, number having min(id) = max(id);
Comments
Post a Comment