I am trying to run an UPDATE query in MySQL.
This query was made and tested in Access, and it worked.
Now I am trying to run it in MySQL and it gives errors.
How is MySQL syntax different from Access SQL?
Here are two versions of the same query which work in Access, but neither one works in MySQL. Can anyone help me 'translate' either version to MySQL?
Thanx,
IM
UPDATE pr2_users_values, workstat
SET
pr2_users_values.f_comp_name = workstat.compname,
pr2_users_values.f_node_addr = workstat.node_addr,
pr2_users_values.f_tcp_ip = workstat.tcpip,
pr2_users_values.f_cpu = workstat.cpu,
pr2_users_values.f_cpu_speed = workstat.cpu_speed,
pr2_users_values.f_ram = workstat.ext_mem,
pr2_users_values.f_drive_c = workstat.drive_c,
pr2_users_values.f_c_free = workstat.free_c,
pr2_users_values.f_drive_d = workstat.drive_d,
pr2_users_values.f_d_free = workstat.free_d
WHERE
f_login=workstat.login;
------------
UPDATE pr2_users_values
INNER JOIN workstat
ON pr2_users_values.f_login=workstat.login
SET
pr2_users_values.f_comp_name = workstat.compname,
pr2_users_values.f_node_addr = workstat.node_addr,
pr2_users_values.f_tcp_ip = workstat.tcpip,
pr2_users_values.f_cpu = workstat.cpu,
pr2_users_values.f_cpu_speed = workstat.cpu_speed,
pr2_users_values.f_ram = workstat.ext_mem,
pr2_users_values.f_drive_c = workstat.drive_c,
pr2_users_values.f_c_free = workstat.free_c,
pr2_users_values.f_drive_d = workstat.drive_d,
pr2_users_values.f_d_free = workstat.free_d;
This query was made and tested in Access, and it worked.
Now I am trying to run it in MySQL and it gives errors.
How is MySQL syntax different from Access SQL?
Here are two versions of the same query which work in Access, but neither one works in MySQL. Can anyone help me 'translate' either version to MySQL?
Thanx,
IM
UPDATE pr2_users_values, workstat
SET
pr2_users_values.f_comp_name = workstat.compname,
pr2_users_values.f_node_addr = workstat.node_addr,
pr2_users_values.f_tcp_ip = workstat.tcpip,
pr2_users_values.f_cpu = workstat.cpu,
pr2_users_values.f_cpu_speed = workstat.cpu_speed,
pr2_users_values.f_ram = workstat.ext_mem,
pr2_users_values.f_drive_c = workstat.drive_c,
pr2_users_values.f_c_free = workstat.free_c,
pr2_users_values.f_drive_d = workstat.drive_d,
pr2_users_values.f_d_free = workstat.free_d
WHERE
f_login=workstat.login;
------------
UPDATE pr2_users_values
INNER JOIN workstat
ON pr2_users_values.f_login=workstat.login
SET
pr2_users_values.f_comp_name = workstat.compname,
pr2_users_values.f_node_addr = workstat.node_addr,
pr2_users_values.f_tcp_ip = workstat.tcpip,
pr2_users_values.f_cpu = workstat.cpu,
pr2_users_values.f_cpu_speed = workstat.cpu_speed,
pr2_users_values.f_ram = workstat.ext_mem,
pr2_users_values.f_drive_c = workstat.drive_c,
pr2_users_values.f_c_free = workstat.free_c,
pr2_users_values.f_drive_d = workstat.drive_d,
pr2_users_values.f_d_free = workstat.free_d;