# CREATE a TABLE on the fly with data from other tables

**URL:** <https://forums.thehomestack.io/t/create-a-table-on-the-fly-with-data-from-other-tables/372>\
**Category:** Databases\
**Created:** [July 18, 2010, 10:36pm UTC](https://forums.thehomestack.io/t/create-a-table-on-the-fly-with-data-from-other-tables/372 "2010-07-18T22:36:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://forums.thehomestack.io/uploads/default/original/1X/161426793bc0d8bdf0d1a6692b3e44446861cc72.jpeg) [@system](https://forums.thehomestack.io/u/system)\
**Post date:** [July 18, 2010, 10:36pm UTC](https://forums.thehomestack.io/t/create-a-table-on-the-fly-with-data-from-other-tables/372/1 "2010-07-18T22:36:24Z")

</div>

I wanted to a way to put data into a table but the table did not exist.

New Tablename:  
INTO Tool\_MiMColors

Here is what you have to do:

```auto
select o.id orderID, p.id productdesignID, o.jobnumber, pc.sequence, pc.code, pc.coverage, pc.coatingType 
INTO Tool_MiMColors
from esporder o
INNER Join ebxproductDesign p
ON p.ID=o.productDesignID
INNER Join ebxproductDesignCoating pc
on pc.productDesignID = p.id
where p.autogenerated = 0
and ordertype in (0,2)
and OrderStatus not in ('Cancelled')
order by o.jobnumber, pc.sequence asc

```

The into and the tablename are the most important command and must go after the select and before the from.
