Link to home
Start Free TrialLog in
Avatar of amillyard
amillyardFlag for United Kingdom of Great Britain and Northern Ireland

asked on

SQL search / results from 2 tables

Using SQL Server 2008 Management Studio

Table 1: MasterAccounts
PK   MasterAccount_ID     int
LeadSourceProvider_ID    int

Table 2: LeadSourceProviders
PK    LeadSourceProvider_ID     int
LeadSourceProviderName       nvarchar(50)

the result I am looking for is as follows (when executing the sql script) :

LeadSourceProviderName,  [count of Master Accounts using that LeadSourceProviderName)
LeadSourceProviders has a 1-to-Many relationship with MasterAccounts table.

How would you construct a SQL query to do this please?
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of amillyard

ASKER

spot on -- thank you aneeshattingal  :-)