What do you mean “outside of a subquery”? Do you mean without grouping?
You can use windowing functions to use aggregates without grouping. Here’s a video with a bunch of tips.