ACCESS SQL (COUNT ISSUE) -
could please me on sql command on access have 2 tables :
## customers ## ## prefers_to_buy ## id | name id | car 52 | george 52 | toyota 55 | lucas 55 | bmw 62 | mary 55 |ferrari 52 |mercedes
what want create query show me name , id of customers , number of car preferences , like"
52|george|2
thanks much!
this requires simple join , application of grouping:
select c.id, c.name, count(p.id) carpreferences customers c inner join preferstobuy p on c.id = p.id group c.id, c.name;
Comments
Post a Comment