You normally can't do that (I'll explain an exception at the end). A select statement makes a query into the table; it can't hold the data in memory.
Nevertheless you could fetch the data and store it in a collection (e.g. RecordSortedList), a temporary table or so. Then you can iterate the collection or even run select statements agains the temporary table.
But there is one more feature you could use: RecordViewCache. It's a bit cryptic and rarely used, but it could be useful in your case.
You need to run a select statement with 'noFetch' and then using the the table buffer in the constructor of RecordViewCache class:
RecordViewCache transTableClearedCache;
MCRHoldCodeTrans mcrTransTableCleared;
select nofetch mcrTransTableCleared
where mcrTransTableCleared.InventRefId == salesOrder.SalesId
&& mcrTransTableCleared.mcrCleared == NoYes::Yes;
transTableClearedCache = new RecordViewCache(mcrTransTableCleared);
Then you can run queries against the buffer (mcrTransTableCleared), which will contain just the records defined by the original select statement.