• Short answer, yes its possible.

    But to actually do it we'd probably need a detailed example. Ideally DDL for the affected tables, some sample data and expected output.

    Your outer query is grouped by CCGregion and year, so is the count column you want to add correlated to that (counting the patients within the region with appointments for that year?) , or would the value of the "inner query" column be the same for every row? As in every row gets the overall count?