You are here: Re: How can easily copy a selection op data (structure and data) « PHP SQL « IT news, forums, messages
Re: How can easily copy a selection op data (structure and data)

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация