Re: [sqlite] Compact statement for table to table copy

2007-10-17 Thread Rich Rattanni
I am not changing the ordering, but i do not want to copy the primary
key field since it is auto increment (I neglected too mention that
before, sorry).
On 10/16/07, Vitali Lovich <[EMAIL PROTECTED]> wrote:
> Well, you don't have to list the columns if you're not changing the
> ordering.
>
> INSERT INTO table1 SELECT * FROM table2;
>
> Rich Rattanni wrote:
> > I have two tables in a database with exactly the same schema
> > (idNum PRIMARY KEY, data1, data2)
> >
> > I want to copy all the records in table 2 to table 1, currently I am
> > using the following statement:
> > INSERT INTO table1 (data1, data2) SELECT data1, data2 FROM table2.
> >
> > Now this is just a simplified illustration, in my case I am copying
> > about 10 columns over.  I was wondering if there was a compact way to
> > write the SQL statement, that copied the  data over from one table to
> > the other ignoring the primary key fields.  I suspect there is not,
> > but I figured it wouldnt hurt to ask.
> >
> > --
> > Thanks,
> > Richard Rattanni
> >
> > -
> > To unsubscribe, send email to [EMAIL PROTECTED]
> > -
> >
> >
> >
>
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
>
>

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Compact statement for table to table copy

2007-10-16 Thread Vitali Lovich
Well, you don't have to list the columns if you're not changing the 
ordering.


INSERT INTO table1 SELECT * FROM table2;

Rich Rattanni wrote:

I have two tables in a database with exactly the same schema
(idNum PRIMARY KEY, data1, data2)

I want to copy all the records in table 2 to table 1, currently I am
using the following statement:
INSERT INTO table1 (data1, data2) SELECT data1, data2 FROM table2.

Now this is just a simplified illustration, in my case I am copying
about 10 columns over.  I was wondering if there was a compact way to
write the SQL statement, that copied the  data over from one table to
the other ignoring the primary key fields.  I suspect there is not,
but I figured it wouldnt hurt to ask.

--
Thanks,
Richard Rattanni

-
To unsubscribe, send email to [EMAIL PROTECTED]
-


  


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Compact statement for table to table copy

2007-10-16 Thread Rich Rattanni
I have two tables in a database with exactly the same schema
(idNum PRIMARY KEY, data1, data2)

I want to copy all the records in table 2 to table 1, currently I am
using the following statement:
INSERT INTO table1 (data1, data2) SELECT data1, data2 FROM table2.

Now this is just a simplified illustration, in my case I am copying
about 10 columns over.  I was wondering if there was a compact way to
write the SQL statement, that copied the  data over from one table to
the other ignoring the primary key fields.  I suspect there is not,
but I figured it wouldnt hurt to ask.

--
Thanks,
Richard Rattanni

-
To unsubscribe, send email to [EMAIL PROTECTED]
-