0 - 1 of 1 tags for SQL query limit number of records table

I have a query and when I run it, I run out of spool space. So, I was wondering if there is some way (other than subsetting based on table data) to limit the number of records that are processed (to the first 10, 100, 1000...). I don't want to simply limit the number of records shown in the output.