Is it possible to create a volatile table and then select from it in the same query?
Are you trying to create the volatile table and select from it in the same unit of work?
If so, you can't do that as only one DDL statement is allowed in a unit of work. So, the SELECT statement has to be a separate unit of work.
You can do this as a derived table where you select from a "table" created using another query:
select * from