How do I create 2 temporary database tables that will be populated and later retrieve the data with SQL to form a third table. For example
<!--- Create and define table 1 with SQL --->
...
<!--- Create and define table 2 with SQL --->
...
<!--- Populate table 1 with SQL --->
...
<!--- Populate table 2 with SQL --->
...
<!--- Fetch data from table 1 and 2 with SQL.
Desired result is in this query --->
...
<!--- Looping through this query --->
...
<!--- Create and define table 1 with SQL --->
...
<!--- Create and define table 2 with SQL --->
...
<!--- Populate table 1 with SQL --->
...
<!--- Populate table 2 with SQL --->
...
<!--- Fetch data from table 1 and 2 with SQL.
Desired result is in this query --->
...
<!--- Looping through this query --->
...