I have read several examples of creating a temporary table with the same structure as the output ...
stackoverflow.com