Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
Shendemiar
Forum Contributor
Posts: 404 Joined: Thu Jan 08, 2004 8:28 am
Post
by Shendemiar » Tue Mar 16, 2004 1:03 pm
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
tim
DevNet Resident
Posts: 1165 Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio
Post
by tim » Tue Mar 16, 2004 1:09 pm
V
Forum Newbie
Posts: 3 Joined: Tue Mar 16, 2004 1:15 pm
Location: Keller, Tx.
Contact:
Post
by V » Tue Mar 16, 2004 1:15 pm
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.
Shendemiar
Forum Contributor
Posts: 404 Joined: Thu Jan 08, 2004 8:28 am
Post
by Shendemiar » Tue Mar 16, 2004 1:22 pm
I perhaps should be looking update instead of insert...
I want no new lines, just a column added to another table.