Heres является примером моей схемы:
|--------------------------|
| **Lead** |
|--------------------------|
| Id |
| LeadId |
| OwnerId |
| ConvertedAccountId |
| ConvertedContactId |
| ConvertedOpportunityId |
| CampaignId |
| RecordTypeId |
|--------------------------|
Как я могу узнать, сколько человек владеет каждым продавцом?
Select OwnerId, count(*) from Lead group by OwnerId
group by
запросов организуются строки с одинаковым OwnerId
в группу. Вы можете google group by
для большего количества примеров.