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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -