[plug] SQL help

Benjamin Woods woodsb02 at iinet.net.au
Tue Dec 13 10:04:34 WST 2005


Hey guys,

I have a mysql database on a server. The database name (for now) is test. In 
it, there are 2 tables which i want to combine in the following way. All I 
want to do is extract one column out of the old table and put it in the new 
table when the new table's equivalent row is not null. There should be no 
place when the new table has a value (not null) when the old table has a 
value. ie) if one is not null, i guarantee you the other will be in that same 
position. I just want to combine them.

DBMS: mysql
Database name: test
New Table: DataProject
Old Table: DataProject2
Primary Key: RefNo
Column to Copy: Refer

The problem is i am running a very old version of mysql (3.23.54). Some other 
people suggested a command, but it didnt work on my version of sql. Any help?

I am new to SQL. The command they said to use was:
UPDATE test.DataProject JOIN test.DataProject2 ON 
test.DataProject.RefNo=test.DataProject2.RefNo SET 
test.DataProject.Refer=test.DataProject2.Refer WHERE test.DataProject.Refer IS 
NULL;



From: Benjamin Woods
woodsb02 at iinet.net.au
Registered Linux User #372573 



More information about the plug mailing list