Home / code / sql

Insert into a new table

With this you can make a new table based on the selected records.

SELECT fields INTO newtable [IN externdatabase] FROM source

Part Explanation
field1, field2 The names of the fields that must be copied to the new table.
newtable The name of the table that should be made. The name must comply to the rules, it cannot have the same name as any other table.
externdatabase The path to another database
source The name of the existing table from where the records are selected. 1 table, more tables or query.

You can also use INSERT INTO to add records to a table.



Latest script: