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

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -