I've exported a database from Access into Excel, but as the person who created the Access database appeared to be not too literate in normalisation, etc. I now have to rebuild some of the structure.
On of the stages in this rebuild requires me to populate the value in one table with the value held in another, based on two other values being equal. Does that make sense?! Here's the SQL...
update tblmaintenance
set system_id = ( select system_id
from tblsystems
where tblsystems.system_name = tblmaintenance.System_Name )
where exists ( select *
from tblsystems
where tblsystems.system_name = tblmaintenance.System_Name );
...but it doesn't work in MySQL v3.23.37. Any ideas??
Cheers,
Dave V.
On of the stages in this rebuild requires me to populate the value in one table with the value held in another, based on two other values being equal. Does that make sense?! Here's the SQL...
update tblmaintenance
set system_id = ( select system_id
from tblsystems
where tblsystems.system_name = tblmaintenance.System_Name )
where exists ( select *
from tblsystems
where tblsystems.system_name = tblmaintenance.System_Name );
...but it doesn't work in MySQL v3.23.37. Any ideas??
Cheers,
Dave V.