>
>
> This will not work for me as I do not know in advance what columns
> exist in test_a or test_b. I only know they are called the same (and
> have the same datatypes).
>
> So is there a dynamic way in which I can generate the INSERT statement
> given the name of the two tables?
>
>
You can writ
On Mon, Mar 29, 2010 at 5:09 PM, Leif Biberg Kristensen
wrote:
> On Monday 29. March 2010 16.51.35 Ole Tange wrote:
>> I would like to do this:
>>
>> insert into test_b (select * from test_a);
>
> Per the SQL standard, there's no inherent order between columns. That said,
> you'll usually get t
On Monday 29. March 2010 16.51.35 Ole Tange wrote:
> I have 2 tables that have the same column names but in different
> order. Similar to this:
>
> create table test_a (col_a text, col_b int);
> create table test_b (col_b int, col_a text);
> insert into test_a values ('abc', 2),( 'def', 3);
I have 2 tables that have the same column names but in different
order. Similar to this:
create table test_a (col_a text, col_b int);
create table test_b (col_b int, col_a text);
insert into test_a values ('abc', 2),( 'def', 3);
I would like to do this:
insert into test_b (select * from