Re: [SQL] new table with a select

2011-08-26 Thread MIkhail Puzanov
Hi, 2011/8/25 > Hello to all, > > > Can anybody tell me the sql instruction to create a new table with a select > of other table? > > I need to create a new table based on paralell of a table of lines. Can > anybody post to me a example? > > CREATE TABLE t AS SELECT * FROM x;

[SQL] new table with a select

2011-08-25 Thread ppdcc
Hello to all, Can anybody tell me the sql instruction to create a new table with a select of other table? I need to create a new table based on paralell of a table of lines. Can anybody post to me a example? Can?t be a buffer, must be lines. Thanks -- Sent via pgsql-sql mailing lis

Re: [SQL] new table with a select

2011-08-25 Thread Florian Weimer
* Julien Cigar: > create table foo as select * from bar; > > just add "where 1=2" if you just want the schema There's also this: CREATE TABLE foo (LIKE bar); This gives you more control over what aspects of the table are duplicated; see the documentation for details. -- Florian Weimer

Re: [SQL] new table with a select

2011-08-25 Thread Julien Cigar
create table foo as select * from bar; just add "where 1=2" if you just want the schema On 08/25/2011 11:44, pp...@sapo.pt wrote: Hello to all, Can anybody tell me the sql instruction to create a new table with a select of other table? I need to create a new table based on paralell of a ta

[SQL] new table with a select

2011-08-25 Thread ppdcc
Hello to all, Can anybody tell me the sql instruction to create a new table with a select of other table? I need to create a new table based on paralell of a table of lines. Can anybody post to me a example? Can?t be a buffer, must be lines. Thanks -- Sent via pgsql-sql mailing