Queries in temporary tables? (help)

Hello
I’ve discovered that SQL (HSQLDB) has the possibility to create temporary tables that you can use to load data in a query, and you can perform operations with that temporary table.
However, I have some doubts about how this work.
Could someone give me an example of this?

I have a demo database, very simple, with the fields ID, primary key, Name, for the name, Lastname, for the last name and age. 20 registries.
Then, I did a simply query. Listing those records whose age be superior to 30 years old.
I have this simple code.

SELECT "Name", 
       "Lastname",
       "Age" 
FROM "tbl_names_and_ages" 
WHERE "Age" > 30

Okay.
How may I load that data from that query to a temporary table and show the results of that temporary table?
With that example, I think I’ll should be able to understand how temporary tables work.
I tried to type some code, but I always get error, so any help would be highly appreciated.

Cheers

You can download that demo database from this link:

https://mega.co.nz/#!RZojmTrS!davoeKfKc_GQh2dn2IQv7D04kZH1w9qHoFEbbHh8ZDI

I’m puzzled as to why you would want a ‘temporary’ table.

You DON"T need a ‘temporary’ table or any (Base macro) code.

The ‘code’ you refer to is SQL ,which you can use to make a permanent query and with this query create a form to display the result.

To do this should do the following simple steps:

  1. ReCreate your query using Create Query in design view - name it qry_GT30 like this:-


    Apologies the image above does not show that I have the set criterion >30 in the Age column

  2. Then use the wizard to create a Form referencing your qry_GT30 like this:

  3. You should then have a form like this if you use the most of the defaults (I choose bright blue for the background)

4 And end up with your database like this:
temporarytable.odb

Hope this helps.