I'm new with sql ans ms-access.
So, i have table tab1, with columns
id, decscription, number
i want to make a query that returns the id of the rows without common description and number.
The desirable output is this
I have tried
GROUP BY id, description, Number HAVING COUNT(*)=1;
but returns logical error.
If you want to return rows that are unique, you can do:
select * from tab1 where not exists (select 1 from tab1 as t where tab1.description = t.description and tab1.number = t.number and tab1.id <> t.id );
You can also do this using aggregation. To get the
select max(id) from tab1 group by description, number having min(id) = max(id);
SELECT id FROM tab1 GROUP BY description, Number HAVING COUNT(*)=1;
Your question isn't quite clear, perhaps:
SELECT id, description, Count(*) As Number FROM tab1 GROUP BY id, description