Page 1 of 1

Combining tables

Posted: Tue Mar 16, 2004 1:03 pm
by Shendemiar
I have two tables:

A: 'x','y','attr'

and

B: 'x','y','ter','attr'

Both having same the same x and y's

I'm trying to insert the 'attr' from A to B

Something like

insert into B ('attr')
select 'attr' from A

But i cant make it work. It gets executed, but all 'attr' valueas in B are still 0

Posted: Tue Mar 16, 2004 1:09 pm
by tim

Posted: Tue Mar 16, 2004 1:15 pm
by V
It should probably also be noted that you'll wanna drop the quotes from the column name you're selecting from, else you'll be inserting the column name and not the data from the column.

Posted: Tue Mar 16, 2004 1:22 pm
by Shendemiar
I perhaps should be looking update instead of insert...

I want no new lines, just a column added to another table.