I have two tables in this query.
[code language="sql"]SELECT [pID],[pName],(SELECT COUNT([tableProfileID]) AS COUNT_RECORDS
[code language="sql"]SELECT [pID],[pName],(SELECT COUNT([tableProfileID]) AS COUNT_RECORDS