Forum Moderators: open

Message Too Old, No Replies

mysql - cross ref table1 (all rows) with table2 and update table3

         

j milo taylor

11:47 am on Apr 27, 2008 (gmt 0)

10+ Year Member



a database of artists. three tables are relevant for this posting:

works (name, type, notes, year, location etc)
work_nodes (workid_worknodes, nodeid_worknodes, id_worknodes) - (integer values)
nodes (nodeid_nodes, node_nodes (e.g. installation, trains, steel)

is there a procedure where i can:

1) search the works table cols (e.g. name, type, notes, location)
for each of the nodes (nodes_node) (there are about 130)

and

2) update the worknodes table (workid_worknodes and nodeid_worknodes)
wherever a match is found

resulting in e.g.

worknodes
id_worknode-----workid_worknodes-----nodeid_worknodes
1 1 6
2 1 36
3 1 101
etc

7 2 56
8 2 47
9 2 67

etc