Having a problem creating subqueries.
I have a query which summaries Premiums by class of business and by unique policy reference and then I have a second query which extracts from the first the count of the number of unique polices by class of business along with the summary of the premiums. I do it this way, because the table the first run pulls from has multiple transactions for the same policy and to perform the count on the first run distorts the output. The second query