Posted by Hilarion on 10/24/05 13:41
> How can easily copy a selection op data (structure and data)
> I would like to copy the result of a query to a new table.
> The query consist of several different tables
This creates a new table based on the SELECT structure (column
names and types - this does not apply any constraints to the
new table, including primary key constraint):
CREATE TABLE new_table AS
SELECT some_columns
FROM some_tables
WHERE some_expressions
This only inserts bulk of data into a table using a select:
INSERT INTO existing_destination_table ( destination_columns )
SELECT source_columns
FROM source_tables
WHERE some_expressions
Hilarion
PS.: It may not work in some DBMS engines but should work in most
of them.
Navigation:
[Reply to this message]
|