I’ve got a tough SQL question for you guys.
I am working with the Webform module of drupal.
How this module works:
– every item on the webform is a new record in the ‘webform_submitted_data’-table,
– sid = registered user
– cid = webform field
Structure of the table:
NID | SID | CID | NO | DATA
1 — 168 — 1 — 0 — XXX
1 — 168 — 2 — 0 — YYY
The problem:
– CID 64 should get updated with the value of CID 56 of the same SID.
I think it should be as follows:
Basically, you self-join the table (matching SIDs) and then you have both fields in your query, so you can simply refer to each at once.