Type: MSSQL
Description: This query will give you counts for a list of Contact Types you give it in the WHERE portion
SELECT
COUNT(c1.accountno) AS Investor_Count
,c1.key4 AS AcctMgr
,c1.key1
FROM
contact1 c1 (NOLOCK)
WHERE
c1.accountno IN (
SELECT
c1.accountno
FROM
contact1 c1
JOIN conthist ch
ON c1.accountno=ch.accountno
WHERE
ch.userid = c1.key4
AND c1.key1 IN (
'Broker'
,'Charity'
,'Consultant'
,'Corporate Pension'
,'Endowment'
,'Family Office'
,'Foundation'
,'High Net Worth'
,'Insurance Company'
,'Investment Advisor'
,'Investment Manager'
,'Investor'
,'Law Firm'
,'Manager'
,'Other'
,'Pension'
,'Prime Broker'
,'Private Bank'
,'Private Equity'
,'Public Pension'
,'Trust'
,'Union Pension'
,'University'
,'Wealth Management'
,''))
GROUP BY
c1.key4
,c1.key1
Bookmark:
These icons link to social bookmarking sites where readers can share and discover new web pages.